Class: ScoutApm::Logging::Loggers::FileLogger

Inherits:
Logger
  • Object
show all
Includes:
ActiveSupport::LoggerSilence
Defined in:
lib/scout_apm/logging/loggers/logger.rb

Overview

The actual instance of the logger.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *_args) ⇒ Object

Other loggers may be extended with additional methods that have not been applied to this file logger. Most likely, these methods will still utilize the exiting logging methods to write to the IO device, however, if this is not the case we may miss logs. With that being said, we shouldn’t impact the original applications intended behavior and let the user know we don’t support it and no-op.



14
15
16
17
18
# File 'lib/scout_apm/logging/loggers/logger.rb', line 14

def method_missing(name, *_args)
  return unless defined?(::Rails)

  ::Rails.logger.warn("Method #{name} called on ScoutApm::Logging::Loggers::FileLogger, but it is not defined.")
end

Instance Method Details

#respond_to_missing?(name, *_args) ⇒ Boolean

More impactful for the broadcast logger.

Returns:

  • (Boolean)


21
22
23
# File 'lib/scout_apm/logging/loggers/logger.rb', line 21

def respond_to_missing?(name, *_args)
  super
end