Permalink
Browse files

Allow to disable file and line collection.

  • Loading branch information...
1 parent 9d18844 commit 179927f77004a75c7bfa96f2d07d2c9050362644 @AlekSi AlekSi committed May 17, 2011
Showing with 5 additions and 3 deletions.
  1. +2 −1 CHANGELOG
  2. +3 −2 lib/gelf/notifier.rb
View
@@ -20,7 +20,8 @@
+ GELF::Logger#level = GELF::INFO
+ allow to change severity mapping;
+ send messages to receivers in round-robin;
- * GELF::Notifier#host and #port are attr_readers now and deprecated (were attr_accessor)
+ * GELF::Notifier#host and #port are attr_readers now and deprecated (were attr_accessor);
+ + allow to disable file and line collection (GELF::Notifier#collect_file_and_line = false);
- deprecated Gelf class removed.
1.0.2, 2010-11-29:
View
@@ -6,14 +6,15 @@ class << self
attr_accessor :last_chunk_id
end
- attr_accessor :enabled
+ attr_accessor :enabled, :collect_file_and_line
attr_reader :max_chunk_size, :level, :default_options, :level_mapping
# +host+ and +port+ are host/ip and port of graylog2-server.
# +max_size+ is passed to max_chunk_size=.
# +default_options+ is used in notify!
def initialize(host = 'localhost', port = 12201, max_size = 'WAN', default_options = {})
@enabled = true
+ @collect_file_and_line = true
self.level = GELF::DEBUG
self.max_chunk_size = max_size
@@ -153,7 +154,7 @@ def extract_hash(object = nil, args = {})
@hash = default_options.merge(self.class.stringify_keys(args.merge(primary_data)))
convert_hoptoad_keys_to_graylog2
- set_file_and_line
+ set_file_and_line if @collect_file_and_line
set_timestamp
check_presence_of_mandatory_attributes
@hash

0 comments on commit 179927f

Please sign in to comment.