Class: LaLogger::Logger
Overview
singleton logger object
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/la_logger.rb', line 20 def initialize if ENV['FLUENTD'] host_, port_ = ENV['FLUENTD'].split ':' host_ ||= 'localhost' port_ ||= 24224 @logger = Fluent::Logger::FluentLogger.new( ENV['FLUENTD_TAG'], host: host_.to_s, port: port_.to_i ) else @logger = Fluent::Logger::ConsoleLogger.open($stderr) end end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
18 19 20 |
# File 'lib/la_logger.rb', line 18 def logger @logger end |