Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Ever miss the forest for the trees?
David J Eddy
David J Eddy

Posted on

     

Ever miss the forest for the trees?

A couple of days ago while working on an automation project I found myself logging progress to the Linux logging sub-system. This worked well enough as it gave me a central place to dump messages without having to install yet _another_ system dependency. This also provides a place that for everyone to look when debugging an issue. 'What do the logs say' is one of the first things I say to myself when something does not work as expected. But what about when the logs stop saying...anything?

So there I was Trucking alongin the zone, everything was great. Knocking out task after task. Then my trust log reading command stopped working.

Useful little command I picked up years ago.

'OK' I think. No problem, so I started the troubleshooting process. Maybe the application is not installing? Nope, it is. Maybe credentials expired? Nope, they are ok. CLI authentication works. Ok, so I roll back a couple commits andboom the messages are back. Time to break this down into the atomic parts. So for the next hour I incremented commits one at a time to see where the issue first appears. (This would be a nice time to use Git Bisect, but I did not :(. )

One commit after another, checking the process. Each time using the following to check the system logs.

I do indeed know how to exit Vim :D.

From two hours back all the way back to the current commit; everything worked as expected. At this point I was reaching the 2 hour 'I am stuck' limit so I reached out to a colleague and asked for a rubber duck session. They agreed and came to sit with me.

I explain What the end goal is, how I was formulating the solution, the start of the issue, what I have tried, and showed the current state.Vim viewing log works, buttail ... | grep...'ing the logs...AARRGRGG! As soon as I said the words I knew what the problem was.

Tail only prints the last10 lines to standard out. So grep only had 10 lines to work with. As my process length increased the logging messages got pushed passed the 10 line mark. To confirm this I tried:

Neat terminal screenshot tool provided byhttps://carbon.now.sh/

Sure enough, the messages were there. :| Just one of those thing I guess.

How about you? Every get so deep into something you missed the obvious?

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
rhymes profile image
rhymes
Such software as dreams are made on.I mostly rant about performance, unnecessary complexity, privacy and data collection.
  • Joined

How about you? Every get so deep into something you missed the obvious?

Yesterday I submitted a PR with the wrong solution because of something like that so yeah, it happens when you're in the zone

For future reference:

tail -f will keep the file open so that you can grep a streaming file. So you can usetail -f file | grep pattern and each time pattern will be appended to the file, it will appear on your screen

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

AWS Certified (x4), Automated Testing / Continuous Integration / Delivery / Deployment (CI/CDs), Cloud, Containers, Dev(Sec)Ops, Software Engineer.
  • Location
    Internet
  • Education
    BFA from IADT Tampa, 4* AWS Certifications
  • Work
    Infrastructure Engineer
  • Joined

More fromDavid J Eddy

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp