Module: LogStash::Util::Loggable
- Included in:
- Clamp::Option::StrictDeclaration, Agent, Api::Modules::Base, Api::Service, BasePipeline, Config::File, Filters::Base, Inputs::Base, Instrument::Collector, Instrument::PeriodicPoller::Base, Instrument::PeriodicPoller::Cgroup, Instrument::Snapshot, Outputs::Base, Plugin, Plugins::Registry, Runner, Setting, ShutdownWatcher, Decorators
- Defined in:
- lib/logstash/util/loggable.rb
Class Method Summary collapse
Instance Method Summary collapse
- #logger ⇒ Object
- #slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold) ⇒ Object
Class Method Details
.included(klass) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/logstash/util/loggable.rb', line 7 def self.included(klass) def klass.log4j_name ruby_name = self.name || self.class.name || self.class.to_s ruby_name.gsub('::', '.').downcase end def klass.logger @logger ||= LogStash::Logging::Logger.new(log4j_name) end def klass.slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold) @slow_logger ||= LogStash::Logging::SlowLogger.new(log4j_name, warn_threshold, info_threshold, debug_threshold, trace_threshold) end def logger self.class.logger end def slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold) self.class.slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold) end end |
Instance Method Details
#logger ⇒ Object
22 23 24 |
# File 'lib/logstash/util/loggable.rb', line 22 def logger self.class.logger end |
#slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold) ⇒ Object
26 27 28 |
# File 'lib/logstash/util/loggable.rb', line 26 def slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold) self.class.slow_logger(warn_threshold, info_threshold, debug_threshold, trace_threshold) end |