Skip to content
Snippets Groups Projects
Commit 83176e73 authored by Adam Cooke's avatar Adam Cooke
Browse files

only submit entries to greylog that apply to the current level

parent 0177a7b8
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3,7 +3,6 @@ require 'logger'
module Postal
class AppLogger < Logger
 
def self.greylog_notifier
@greylog_notifier ||= Postal.config.logging.greylog ? GELF::Notifier.new(Postal.config.logging.greylog.host, Postal.config.logging.greylog.port) : nil
 
Loading
Loading
@@ -17,7 +16,7 @@ module Postal
 
def add(severity, message = nil, progname = nil)
super
if n = self.class.greylog_notifier
if severity >= @level && n = self.class.greylog_notifier
begin
if message.nil?
message = block_given? ? yield : progname
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment