# config/log4perl.conf - Log::Log4perl configuration file for Business::Shipping

# See documentation of Log::Log4perl for more information.
# Business::Shipping always logs the module and subroutine name as the category.

# Variables
# The default configuration is to log only Warnings to the Screen, but some of
# commented-out options are to log to files and/or debugging information too.
handlers        = Screen
#handlers       = Screen, ErrorFile, DebugFile

layout_class1   = Log::Log4perl::Layout::PatternLayout
layout_pattern1 = %d %M:%L %p> %m%n
layout_pattern2 = [%r] %M:%L %m%n
layout_pattern3 = %M{3}:%L %p> %m%n
log_dir         = /usr/local/B_Shipping/log

#log_dir         = ~_~DEFAULT_LOG_DIR~_~

# Normal (dynamic, optionally set via log_level() )
log4perl.category.Business.Shipping = \
    sub {                                                                      \
        my $l4p_level = $Business::Shipping::Logging::Current_Level || 'WARN'; \
        return "$l4p_level, ${handlers}";                                      \
    }

# Static version of Normal
#log4perl.category.Business::Shipping = WARN, ${handlers}

# Normal debugging information.
#log4perl.category.Business::Shipping = INFO, ${handlers}

# Verbose debugging information.
#log4perl.category.Business::Shipping = DEBUG, ${handlers}

# Very Verbose debugging information.
#log4perl.category.Business::Shipping = TRACE, ${handlers}

# Debugging for only one certain module.
#log4perl.category.Business::Shipping::UPS_Online::Tracking = TRACE, ${handlers}

# log/error.log - ERROR and FATAL
log4perl.appender.ErrorFile           = Log::Log4perl::Appender::File
log4perl.appender.ErrorFile.filename  = ${log_dir}/error.log
log4perl.appender.ErrorFile.mode      = append
log4perl.appender.ErrorFile.Threshold = ERROR
log4perl.appender.ErrorFile.layout    = ${layout_class1}
log4perl.appender.ErrorFile.layout.ConversionPattern = ${layout_pattern1}

# log/debug.log - DEBUG, INFO, and WARN
log4perl.appender.DebugFile           = Log::Log4perl::Appender::File
log4perl.appender.DebugFile.filename  = ${log_dir}/debug.log
log4perl.appender.DebugFile.mode      = append
log4perl.appender.DebugFile.Threshold = DEBUG
log4perl.appender.DebugFile.layout    = ${layout_class1}
log4perl.appender.DebugFile.layout.ConversionPattern = ${layout_pattern1}

# screen - FATAL
log4perl.appender.Screen            = Log::Log4perl::Appender::Screen
log4perl.appender.Screen.stderr     = 1
#log4perl.appender.Screen.Threshold  = TRACE
log4perl.appender.Screen.layout     = ${layout_class1}
log4perl.appender.Screen.layout.ConversionPattern = ${layout_pattern3}
