Class: Patriot::Util::Logger::Log4rFactory

Inherits:
Factory
  • Object
show all
Includes:
Singleton
Defined in:
lib/patriot/util/logger/log4r_factory.rb

Overview

a logger factory implementation for Log4r logger

Constant Summary collapse

LOG_LEVEL_KEY =

configuration key for log level

:log_level
DEFAULT_LOG_LEVEL =

default log level

'DEBUG'
FORMAT_KEY =

configuration key for log format

:log_format
DEFAULT_LOG_FORMAT =

default log format

'%m'
OUTPUTTERS_KEY =

configuration key for log outputers

:log_outputters
OUTPUTTER_KEY_PREFIX =

configuration prefix for log outputer

:log_outputter

Constants inherited from Factory

Factory::DEFAULT_LOGGER_FACTORY_CLASS, Factory::FACTORY_CLASS_KEY

Instance Method Summary collapse

Methods inherited from Factory

create_logger, get_factory_class_name, #get_logger, #initialize

Constructor Details

This class inherits a constructor from Patriot::Util::Logger::Factory

Instance Method Details

#create_formatter(config) ⇒ Object

create formatter based on the configuration



53
54
55
56
57
# File 'lib/patriot/util/logger/log4r_factory.rb', line 53

def create_formatter(config)
  log_format = get_format_config(config)
  formatter  = Log4r::PatternFormatter.new(:pattern => log_format)
  return formatter
end