NAME

OpenInteract2::Log - Initialization for log4p logger

SYNOPSIS

# Use the log in a website
OpenInteract2::Log->init_from_website( $website_dir );
 
# Create a log on the fly, using the default level, saved to file
# 'oi2_tests.log'
my $logfile = 'oi2_tests.log';
OpenInteract2::Log->init_file( $logfile );

# Same, but using 'info' as level
use Log::Log4perl qw( :levels );
OpenInteract2::Log->init_file( $logfile, $INFO );

# Create a log on the fly, sent to the screen
OpenInteract2::Log->init_screen

# Same, but using 'info' as level
OpenInteract2::Log->init_screen( $INFO );

DESCRIPTION

This just contains some centralized initialization methods so that Log::Log4perl is initialized and happy.

init_from_website( $website_dir )

Reads in the configuration file at $website_dir/conf/log4perl.conf and initializes the logger with it.

init_file( $file, [ $root_logger_level ] )

Initializes the root logger to append its messages to $file at the level $root_logger_level (as exported by Log::Log4perl. If the level is not provided '$WARN' is used.

If $file not given behaves as init_screen().

init_screen( [ $root_logger_level ] )

Initializes the root logger to write its messages to the screen at the level $root_logger_level (as exported by Log::Log4perl. If the level is not provided '$WARN' is used.

COPYRIGHT

Copyright (c) 2002-2003 Chris Winters. All rights reserved.

AUTHORS

Chris Winters <chris@cwinters.com>