Class: Lumberjack::DataDogDevice
- Inherits:
-
JsonDevice
- Object
- JsonDevice
- Lumberjack::DataDogDevice
- Defined in:
- lib/lumberjack_data_dog_device.rb
Overview
This Lumberjack device logs output to another device as JSON formatted text that maps fields to the standard JSON payload for DataDog log collection.
Defined Under Namespace
Modules: ExceptionHash Classes: DataDogTagsFormatter, DurationFormatter, MessageExceptionFormatter
Instance Attribute Summary collapse
-
#backtrace_cleaner ⇒ Object
You can specify a backtrace cleaner that will be called with exception backtraces before they are added to the payload.
-
#max_message_length ⇒ Object
You can specify a limit on the message size.
Instance Method Summary collapse
-
#initialize(stream_or_device, backtrace_cleaner: nil, max_message_length: nil) ⇒ DataDogDevice
constructor
A new instance of DataDogDevice.
Constructor Details
#initialize(stream_or_device, backtrace_cleaner: nil, max_message_length: nil) ⇒ DataDogDevice
Returns a new instance of DataDogDevice.
141 142 143 144 145 |
# File 'lib/lumberjack_data_dog_device.rb', line 141 def initialize(stream_or_device, backtrace_cleaner: nil, max_message_length: nil) super(stream_or_device, mapping: data_dog_mapping) self.backtrace_cleaner = backtrace_cleaner self. = end |
Instance Attribute Details
#backtrace_cleaner ⇒ Object
You can specify a backtrace cleaner that will be called with exception backtraces before they are added to the payload. You can use this to remove superfluous lines, compress line length, etc. One use for it is to keep stack traces clean and prevent them from overflowing the limit on the payload size for an individual log entry.
135 136 137 |
# File 'lib/lumberjack_data_dog_device.rb', line 135 def backtrace_cleaner @backtrace_cleaner end |
#max_message_length ⇒ Object
You can specify a limit on the message size. Messages over this size will be split into multiple log entries to prevent overflowing the limit on message size which makes the log entries unparseable.
139 140 141 |
# File 'lib/lumberjack_data_dog_device.rb', line 139 def @max_message_length end |