use Log::Log4perl; Log::Log4perl->init("log.conf");
log.conf 文件的内容为:
1 2 3 4 5 6 7 8 9 10 11 12
############################################################ # A simple root logger with a Log::Log4perl::Appender::File # file appender in Perl. ############################################################ log4perl.rootLogger=ERROR, LOGFILE
$logger->is_trace() # True if trace messages would go through $logger->is_debug() # True if debug messages would go through $logger->is_info() # True if info messages would go through $logger->is_warn() # True if warn messages would go through $logger->is_error() # True if error messages would go through $logger->is_fatal() # True if fatal messages would go through