use warnings; use strict; use Log::Log4perl qw(get_logger); Log::Log4perl->init("log.conf"); my $log = get_logger("fileLogger"); $log->debug("Log only Debug message"); $log->info("Log only Info message"); $log->error("Log only Error message"); $log->logwarn("Log only We have hit a warning\n");