lib/appsignal.rb in appsignal-0.12.beta.8 vs lib/appsignal.rb in appsignal-0.12.beta.9

- old
+ new

@@ -135,19 +135,25 @@ def logger @in_memory_log = StringIO.new unless @in_memory_log @logger ||= Logger.new(@in_memory_log).tap do |l| l.level = Logger::INFO - l.formatter = Logger::Formatter.new + l.formatter = log_formatter end end + def log_formatter + proc do |severity, datetime, progname, msg| + "[#{datetime.strftime('%Y-%m-%dT%H:%M:%S')} (process) ##{Process.pid}][#{severity}] #{msg}" + end + end + def start_logger(path) if path && File.writable?(path) && !ENV['DYNO'] && !ENV['SHELLYCLOUD_DEPLOYMENT'] @logger = Logger.new(File.join(path, 'appsignal.log')) - @logger.formatter = Logger::Formatter.new + @logger.formatter = log_formatter else @logger = Logger.new($stdout) @logger.formatter = lambda do |severity, datetime, progname, msg| "appsignal: #{msg}\n" end