lib/semantic_logger/appender/mongodb.rb in semantic_logger-0.11.4 vs lib/semantic_logger/appender/mongodb.rb in semantic_logger-1.0.0
- old
+ new
@@ -142,22 +142,15 @@
}
document[:application] = application if application
document[:message] = self.class.strip_colorizing(log.message) if log.message
document[:duration] = log.duration if log.duration
document[:tags] = log.tags if log.tags && (log.tags.size > 0)
-
- if log.payload
- if log.payload.is_a?(Exception)
- exception = log.payload
- document[:exception] = {
- :name => exception.class.name,
- :message => exception.message,
- :stack_trace => exception.backtrace
- }
- else
- document[:payload] = log.payload
- end
- end
+ document[:payload] = log.payload if log.payload
+ document[:exception] = {
+ :name => log.exception.class.name,
+ :message => log.exception.message,
+ :stack_trace => log.exception.backtrace
+ } if log.exception
document
end
end
# Strip the standard Rails colorizing from the logged message
\ No newline at end of file