Using rails tagged logging, how can I log the log level of a message?

My rails logger configuration currently logs the current time and UUID, like this:

config.logger ="#{Rails.root}/log/#{ENV['RAILS_ENV']}.log", 'daily'))
config.log_tags = [ {'%Y-%m-%d %H:%M:%S.%L')}, :uuid]

Is there a way to also log the current message's log level?

i.e., if I call logger.debug, the tag [DEBUG] is added to the message.


  • Railscasts shows how to override the logger to output the severity of the log message by overriding the SimpleFormatter#call method:

    class Logger::SimpleFormatter
      def call(severity, time, progname, msg)
        "[#{severity}] #{msg}\n"

    See for the details.