Live data from Hacker News

How To Write Good Log Messages

trottercashion.com

51–57 of 57 posts

Re: How To Write Good Log Messages

#51
post #49

Earlier quoted context omitted.

When you roll the logs at say 500Mb, there's the chance our monitoring system misses an error Sorry but then your monitoring system is broken? Why is its operation tied to log chunking? Multiple logfiles for a day are harder to search Not really. Often enough interesting events span multiple days (or cross midnight) anyways. Thus regardless of chunking you have to be prepared for that case. What benefits does a split…

>> Sorry but then your monitoring system is broken? Why is its operation tied to log chunking? Yours clearly bends some unbendable truths of the known universe ;-) A monitoring system ordinarily samples the logfile at a given point in time, that is an open followed by a close operation on the logfile (lest you run into phantom disk usage issues caused by holding an open file handle to a compressed / rotated logfile).…

Possible workarounds include logfile streaming (say via a pipe on the filesystem) but that introduces much larger problems and would in no way be compatible with the app rolling its log files.

What you call a workaround (streaming to a central location via syslog or scribe) happens to be the standard approach in my corner of the world. Analytics and monitoring operate naturally on the stream because, as you point out, sampling on rolling logfiles is not exactly reasonable, neither is scattering logfiles across application servers.

I'm leaving this discussion at this point because I'm not interested in your condescending tone and insults. It appears you haven't even centralized your logging, yet feel entitled to give ops-advice that is at odds with how the rest of the world operates.

Re: How To Write Good Log Messages

#52
post #51

Earlier quoted context omitted.

>> Sorry but then your monitoring system is broken? Why is its operation tied to log chunking? Yours clearly bends some unbendable truths of the known universe ;-) A monitoring system ordinarily samples the logfile at a given point in time, that is an open followed by a close operation on the logfile (lest you run into phantom disk usage issues caused by holding an open file handle to a compressed / rotated logfile).…

Possible workarounds include logfile streaming (say via a pipe on the filesystem) but that introduces much larger problems and would in no way be compatible with the app rolling its log files. What you call a workaround (streaming to a central location via syslog or scribe) happens to be the standard approach in my corner of the world. Analytics and monitoring operate naturally on the stream because, as you point out…

>> streaming to a central location via syslog or scribe

Ahh, "man mkpipe", you're mixing up a separate concept - streaming to a remote host vs streaming via a pipe on the filesystem.

>> standard approach in my corner of the world

Syslog streaming has been a common approach since the ~70s i'd guess? Likely before.

>> yet feel entitled to give ops-advice that is at odds with how the rest of the world operates

Hopefully, you see the irony in this.

Re: How To Write Good Log Messages

#53
post #51

Earlier quoted context omitted.

Possible workarounds include logfile streaming (say via a pipe on the filesystem) but that introduces much larger problems and would in no way be compatible with the app rolling its log files. What you call a workaround (streaming to a central location via syslog or scribe) happens to be the standard approach in my corner of the world. Analytics and monitoring operate naturally on the stream because, as you point out…

>> streaming to a central location via syslog or scribe Ahh, "man mkpipe", you're mixing up a separate concept - streaming to a remote host vs streaming via a pipe on the filesystem. >> standard approach in my corner of the world Syslog streaming has been a common approach since the ~70s i'd guess? Likely before. >> yet feel entitled to give ops-advice that is at odds with how the rest of the world operates Hopefully…

Cut it out already...

you're mixing up a separate concept - streaming to a remote host vs streaming via a pipe on the filesystem

You said above, quote: but that introduces much larger problems and would in no way be compatible with the app rolling its log files.

Why would you have log-pipes, or log-files on your app-servers to begin with?

Syslog streaming has been a common approach since the ~70s i'd guess?

Then how come you're not doing it?

Hopefully, you see the irony in this.

All I'm seeing is a constant stream of arrogance that doesn't seem to be backed up. Also, the command that you wanted to helpfully point out is called "mkfifo" or "mknod".

Re: How To Write Good Log Messages

#54
post #53

Earlier quoted context omitted.

>> streaming to a central location via syslog or scribe Ahh, "man mkpipe", you're mixing up a separate concept - streaming to a remote host vs streaming via a pipe on the filesystem. >> standard approach in my corner of the world Syslog streaming has been a common approach since the ~70s i'd guess? Likely before. >> yet feel entitled to give ops-advice that is at odds with how the rest of the world operates Hopefully…

Cut it out already... you're mixing up a separate concept - streaming to a remote host vs streaming via a pipe on the filesystem You said above, quote: but that introduces much larger problems and would in no way be compatible with the app rolling its log files. Why would you have log-pipes, or log-files on your app-servers to begin with? Syslog streaming has been a common approach since the ~70s i'd guess? Then how…

>> Hopefully, you see the irony in this.

>> All I'm seeing is a constant stream of arrogance

Perhaps not...

Re: How To Write Good Log Messages

#55
post #7

I personally have found a lot of difficulty with JSON-based logs, because tools like `grep` and `cut` don't suffice; I usually have to write a more complex regex with `sed` in order to extract useful information I want. Anyone have a good utility for managing JSON in log files?

Here's a bash JSON parser.

https://github.com/dominictarr/JSON.sh

Re: How To Write Good Log Messages

#56
post #44

This may be a bit out of scope for this post, but at Google I used to get a lot of mileage out of a system I worked on called Dapper: http://static.googleusercontent.com/external_content/untrust... It uses thread-local storage and RPC library instrumentation to thread a fixed request-id through every RPC call and thread handling a particular user request. Then you can do things like automatically adding the request I…

Dapper looks fantastic. It reminded me somewhat of the ancient ARM (1996) http://en.wikipedia.org/wiki/Application_Response_Measuremen... which I thought had died.

I was pleasantly surprised to see that there's a module for Apache in the works.

Re: How To Write Good Log Messages

#57
post #44

This may be a bit out of scope for this post, but at Google I used to get a lot of mileage out of a system I worked on called Dapper: http://static.googleusercontent.com/external_content/untrust... It uses thread-local storage and RPC library instrumentation to thread a fixed request-id through every RPC call and thread handling a particular user request. Then you can do things like automatically adding the request I…

Dapper looks fantastic. It reminded me somewhat of the ancient ARM (1996) http://en.wikipedia.org/wiki/Application_Response_Measuremen... which I thought had died. I was pleasantly surprised to see that there's a module for Apache in the works.

Wow, that's cool. The two systems are very similar, and I wouldn't be shocked if ARM was the inspiration for Dapper.
Post reply on HN