Class: Bosh::Cpi::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/bosh/cpi/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(log_device) ⇒ Logger

Returns a new instance of Logger.



5
6
7
# File 'lib/bosh/cpi/logger.rb', line 5

def initialize(log_device)
  super(log_device)
end

Instance Method Details

#set_request_id(req_id) ⇒ Object



9
10
11
12
13
14
# File 'lib/bosh/cpi/logger.rb', line 9

def set_request_id(req_id)
  original_formatter = Logger::Formatter.new
  self.formatter = proc { |severity, datetime, progname, msg|
    original_formatter.call(severity, datetime, "[req_id #{req_id}]#{progname}", msg)
  }
end