From: Eric Wong Date: 2009-09-03T05:23:21+09:00 Subject: Re: [ANN] clogger 0.0.4 - configurable request logging for Rack Iñaki Baz Castillo wrote: > El Miércoles, 2 de Septiembre de 2009, Eric Wong escribió: > > > > Clogger is Rack middleware for logging HTTP requests. The log format > > > > is customizable so you can specify exactly which fields to log. > > > > > > Is it possible to make Clogger using Logging class? > > > > If you mean Logger, then yes, > > No, I mean Logging: > > http://logging.rubyforge.org/ > > "Logging is a flexible logging library for use in Ruby programs based on the > design of Java‘s log4j library. It features a hierarchical logging system, > custom level names, multiple output destinations per log event, custom > formatting, and more." It seems to support the "<<" parameter, so I would say yes, it does work. If you run into any issues, let me know. > > you can specify anything that responds to > > "<<" as your :logger parameter: > > > > use Clogger, :logger => Logger.new("/path/to/log") > > How to set the Logger debug level there? You can always create the object first and set whatever options you want: logger = Logger.new("/path/to/log") logger.level = Logger::DEBUG use Clogger, :logger => logger Of course, the "<<" method Clogger uses internally bypasses level checks in Logger (same as Rack::CommonLogger) -- Eric Wong