Compliance between Lotus::Logger and Rack::Common::Logger

I’ve recently create Lotus::Logger to log from anywhere inside Lotus app, along with the application name

Currently, i’m working on replacing current implementation of Rack::Common::Logger with recently created one.
The reason why we should replace Rack::Common::Logger included of two points:

  • Different display format
  • Different time stamp, Lotus::Logger is using utc, and Rack::Common::Logger using local time.

So what do you guys think about how we should solving this different?

@huydx Rack::Common:Logger does not provide a logger for the app. It simply is a middleware that collect request stats and parse it on to the next middleware that suppose to tap in and log.

The implementation of our Rack::Common::Logger clearly states:

def call(env)
  began_at = Time.now
  status, header, body = @app.call(env)
  header = Utils::HeaderHash.new(header)
  log(env, status, header, began_at)
  [status, header, body]
end

the began_at can be cast to UTC in Lotus::Logger by began_at.utc.

Let me know if you want to pair on this. I am free this weekend.