#log_level added, rack-logger 3.2.9 -compatible
This commit is contained in:
parent
fd8860766b
commit
26853e31e2
|
@ -64,6 +64,11 @@ class Semlogger < ::Logger
|
|||
end
|
||||
|
||||
attr_accessor :logdev, :level, :progname
|
||||
|
||||
# some libs use #log_level
|
||||
def log_level=( level) @level = level end
|
||||
def log_level() @level end
|
||||
|
||||
class <<self
|
||||
attr_accessor :progname, :logger
|
||||
|
||||
|
@ -110,9 +115,7 @@ class Semlogger < ::Logger
|
|||
|
||||
def add severity, message = nil, progname = nil, &block
|
||||
severity ||= UNKNOWN
|
||||
if @logdev.nil? or severity < @level
|
||||
return true
|
||||
end
|
||||
return true if @logdev.nil? or severity < @level
|
||||
progname ||= @progname
|
||||
if message.nil?
|
||||
if block_given?
|
||||
|
|
|
@ -4,10 +4,9 @@ class Semlogger::Rack < Rails::Rack::Logger
|
|||
@data = data
|
||||
end
|
||||
|
||||
def call_app env
|
||||
request = ActionDispatch::Request.new env
|
||||
def call_app request, env
|
||||
path = request.filtered_path
|
||||
Rails.logger.info Semlogger.custom :connection, request.ip, Thread.current.object_id, request.request_method, path
|
||||
Semlogger.custom( :connection, request.ip, Thread.current.object_id, request.request_method, path).info
|
||||
@app.call env
|
||||
ensure
|
||||
ActiveSupport::LogSubscriber.flush_all!
|
||||
|
|
Loading…
Reference in a new issue