036JSyslog.t   [plain text]

use Log::Log4perl;
use Test;

BEGIN {plan tests => 1}
ok(1); #always succeed

#skipping on win32 systems
eval {
	require Sys::Syslog;
if ($@){
   print STDERR "Sys::Syslog not installed, skipping...\n";

print <<EOL;

Since syslog() doesn't return any value that indicates sucess or failure,
I'm just going to send messages to syslog.  These messages should
appear in the log file generated by syslog(8):

INFO - info message 1
WARN - warning message 1

Error messages probably indicate problems with related syslog modules
that exist on some systems.


my $conf = <<CONF;
log4j.category.cat1      = INFO, myAppender


#There seems to be problems with Sys::Syslog on some platforms.
#So we'll just run this, maybe it will work and maybe it won't.
#A failure won't keep Log4perl from installing, but it will give
#some indication to the user whether to expect syslog logging
#to work on their system.

eval {


   my $logger = Log::Log4perl->get_logger('cat1');

   $logger->debug("debugging message 1 ");
   $logger->info("info message 1 ");      
   $logger->warn("warning message 1 ");