lib/semantic_logger/appender/syslog.rb in semantic_logger-2.17.0 vs lib/semantic_logger/appender/syslog.rb in semantic_logger-2.18.0
- old
+ new
@@ -237,10 +237,17 @@
Proc.new do |log|
tags = log.tags.collect { |tag| "[#{tag}]" }.join(" ") + " " if log.tags && (log.tags.size > 0)
message = log.message.to_s
message << ' -- ' << log.payload.inspect if log.payload
- message << ' -- ' << "#{log.exception.class}: #{log.exception.message}\n#{(log.exception.backtrace || []).join("\n")}" if log.exception
+ log.each_exception do |exception, i|
+ if i == 0
+ message << ' -- '
+ else
+ message << "\nCause: "
+ end
+ message << "#{exception.class}: #{exception.message}\n#{(exception.backtrace || []).join("\n")}"
+ end
duration_str = log.duration ? "(#{'%.1f' % log.duration}ms) " : ''
"#{log.level.to_s[0..0].upcase} [#{$$}:#{log.thread_name}] #{tags}#{duration_str}#{log.name} -- #{message}"
end