semantic_logger 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -148,6 +148,7 @@ module SemanticLogger
|
|
148
148
|
document[:application] = application if application
|
149
149
|
document[:message] = self.class.strip_colorizing(log.message) if log.message
|
150
150
|
document[:duration] = log.duration if log.duration
|
151
|
+
document[:tags] = log.tags if log.tags && (log.tags.size > 0)
|
151
152
|
|
152
153
|
if log.payload
|
153
154
|
if log.payload.is_a?(Exception)
|
@@ -29,7 +29,9 @@ module SemanticLogger #:nodoc:
|
|
29
29
|
logger = Rails.logger || config.logger || begin
|
30
30
|
path = config.paths.log.to_a.first
|
31
31
|
logger = ActiveSupport::BufferedLogger.new(path)
|
32
|
-
|
32
|
+
# Translate trace to debug level for BufferedLogger
|
33
|
+
level = config.log_level == :trace ? :debug : config.log_level
|
34
|
+
logger.level = ActiveSupport::BufferedLogger.const_get(level.to_s.upcase)
|
33
35
|
logger.auto_flushing = false if Rails.env.production?
|
34
36
|
logger
|
35
37
|
rescue StandardError => e
|
@@ -50,7 +52,7 @@ module SemanticLogger #:nodoc:
|
|
50
52
|
SemanticLogger::Logger.appenders << SemanticLogger::Appender::Logger.new(logger)
|
51
53
|
|
52
54
|
# Set the default log level based on the Rails config
|
53
|
-
SemanticLogger::Logger.default_level =
|
55
|
+
SemanticLogger::Logger.default_level = config.log_level
|
54
56
|
|
55
57
|
# Replace the default Rails loggers
|
56
58
|
Rails.logger = config.logger = SemanticLogger::Logger.new(Rails)
|