pjlegato / ring.middleware.logger

Ring middleware to log each request
58 stars 24 forks source link

Logging to STDOUT #8

Open aew opened 10 years ago

aew commented 10 years ago

Is there a way to accomplish logging to standard out without rewriting wrap-with-logger?

pjlegato commented 10 years ago

aew, yes! Internally, it uses https://github.com/pjlegato/onelog to do the actual logging. You can reconfigure onelog as described in its README to log whereever you like. Logging to the special file /dev/stdout should do it on a Unix or Mac system.

You can also reconfigure log4j (the underlying Java logging library that onelog wraps) , which is somewhat more complex, but considerably more flexible. For example, you can route log lines by log level to different endpoints, interface with syslog, etc.

If your app runs in a managed J2EE container such as Immutant, then you can also reconfigure logging through the Immutant UI and config files.