DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Fabric: Tailing Log Files on Multiple Machines

Fabric: Tailing Log Files on Multiple Machines

Mark Needham user avatar by
Mark Needham
·
Jan. 18, 13 · Interview
Like (0)
Save
Tweet
Share
7.33K Views

Join the DZone community and get the full member experience.

Join For Free

We wanted to tail one of the log files simultaneously on 12 servers this afternoon to try and see if a particular event was being logged and rather than opening 12 SSH sessions decided to get Fabric to help us out.

My initial attempt to do this was the following:

fab -H host1,host2,host3 -- tail -f /var/www/awesome/current/log/production.log

It works but the problem is that by default Fabric runs the specified command one machine after the other so we’ve actually managed to block Fabric with the tail command on ‘host1′.

The output of host1′s log file will be printed to the terminal but nothing from the other two hosts.

Nathan showed me how to get around this problem by making use of Fabric’s parallel execution which we can enable with the ‘-P’ option:

fab -P --linewise -H host1,host2,host3 -- tail -f /var/www/awesome/current/log/production.log

We also used the ‘likewise’ flag to ensure that data between the different tail processes didn’t get mixed up although this wasn’t necessary because Fabric defaults to likewise if you’re using parallel execution mode anyway.

On a side-note, Paul Ingles wrote up the approach taken to make data from log files more accessible using a Kafka driven event pipeline but in this case we haven’t got round to wiring this data up yet so Fabric it is for now.



Machine

Published at DZone with permission of Mark Needham, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Playwright vs. Cypress: The King Is Dead, Long Live the King?
  • When AI Strengthens Good Old Chatbots: A Brief History of Conversational AI
  • Three SQL Keywords in QuestDB for Finding Missing Data
  • How to Cut the Release Inspection Time From 4 Days to 4 Hours

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: