use Log::Log4perl; Log::Log4perl->init("surv.conf"); #name of my config file my $log = Log::Log4perl->get_logger(); $log->info("connecting to database"); my $dbh = DBI->connect(ORACLE_DATABASE_NAME, ORACLE_USER, ORACLE_PASSWORD) or die $log->fatal($DBI::errstr);