Class: SearchKit::Logger

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/search_kit/logger.rb

Overview

The SearchKit logger, handled in its own class mainly for the purpose of allowing the daemonized process to quickly and cleanly reinitialize its connection to logfiles even after its process has been decoupled.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLogger

Returns a new instance of Logger.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/search_kit/logger.rb', line 15

def initialize
  environment = SearchKit.config.app_env

  loginfo = [
    SearchKit.config.app_dir,
    SearchKit.config.log_dir,
    "service-layer-#{environment}.log"
  ]

  logpath = File.join(*loginfo)
  default = ::Logger.new(logpath, "daily")

  @logger = SearchKit.config.logger || default
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



11
12
13
# File 'lib/search_kit/logger.rb', line 11

def logger
  @logger
end