... fixes
This commit is contained in:
parent
e04b61dd4a
commit
3b20edf5cf
|
@ -69,17 +69,17 @@ class Semlogger < ::Logger
|
||||||
|
|
||||||
def new_rails_logger config
|
def new_rails_logger config
|
||||||
require 'semlogger/rack'
|
require 'semlogger/rack'
|
||||||
logdev = ::Rails.root.join( 'log', "#{::Rails.env.to_s.gsub('%', '%%')}.%Y-%m-%d.%$.log")
|
logdev = ::Rails.root.join( 'log', "#{::Rails.env.to_s.gsub('%', '%%')}.%Y-%m-%d.%$.log").to_s
|
||||||
logger = nil
|
logger = nil
|
||||||
if Rails.env.production?
|
if Rails.env.production?
|
||||||
logger.new logdev
|
logger = new logdev
|
||||||
logger.level = INFO
|
logger.level = Semlogger::INFO
|
||||||
elsif Rails.env.development?
|
elsif Rails.env.development?
|
||||||
logger.new Semlogger::Multiplex.new( Semlogger::FInfo.new( Semlogger::Printer.new), Semlogger::Writer.new( logdev))
|
logger = new Semlogger::Multiplex.new( Semlogger::FInfo.new( Semlogger::Printer.new), Semlogger::Writer.new( logdev))
|
||||||
logger.level = DEBUG
|
logger.level = Semlogger::DEBUG
|
||||||
else
|
else
|
||||||
logger.new logdev
|
logger = new logdev
|
||||||
logger.level = DEBUG
|
logger.level = Semlogger::DEBUG
|
||||||
end
|
end
|
||||||
config.middleware.swap Rails::Rack::Logger, Semlogger::Rack, [], {reqid: :uuid}
|
config.middleware.swap Rails::Rack::Logger, Semlogger::Rack, [], {reqid: :uuid}
|
||||||
config.logger = logger
|
config.logger = logger
|
||||||
|
|
Loading…
Reference in a new issue