Logs Are Streams, Not Files
August 26 2011, 6:17 AM
A program using
stdout
for logging can use syslog without needing to implement any syslog awareness into the program, by piping to the standardlogger
command available on all modern unixes:$ mydaemon | loggerPerhaps we want to split the stream and log to a local file as well as syslog:
$ mydaemon | tee /var/log/mydaemon.log | loggerA program which uses
stdout
is equipped to log in a variety of ways without adding any weight to its codebase or configuration format.
via adam.heroku.com
Via http://news.ycombinator.com/item?id=2396695, which has an interesting comment about Google logging:
> Am I the only person that doesn't want logging to block or buffer?
If it's an error that you're logging the moment before you crash, then you probably want it to block.
At Google LOG(ERROR) blocks but LOG(INFO) doesn't, for this reason.