|
hi,
i have a problem with Log::Dispatch::DBI:
trying to use it as follows:
BEGIN {
our $VERSION = 1.0;
my $driver = "mysql";
my $database = "eventlog";
my $hostname="127.0.0.1";
my $port='3306';
my $user='username';
my $password='passwd';
my $socket='/tmp/mysql.sock';
my $dsn = "DBI:$driver:database=$database;host=$hostname;port=$port;mysql_socket=$socket";
my $dblocal = DBI->connect($dsn, $user, $password) or die "couldn't connect: $DBI::errstr";
my $log = Log::Dispatch::DBI->new(
name => 'dbi',
min_level => 'info',
dbh => $dblocal,
) or die "can't create new log";
$log->log(level => 'info', messsage => 'something BAD happened');
which gives me the following error:
Mandatory parameter 'message' missing in call to Log::Dispatch::Output::log
at /usr/local/lib/perl/5.8.8/Params/ValidateXS.pm line 11
Params::Validate::__ANON__('Mandatory parameter \'message\' missing in call to Log::Dispa..
+.') called at /usr/local/share/perl/5.8.8/Log/Dispatch/Output.pm line 30
Log::Dispatch::Output::log('undef', 'level', 'info', 'messsage', 'something BAD happened')
+called at firsttry.pl line 43
main::BEGIN() called at firsttry.pl line 94
eval {...} called at firsttry.pl line 94
BEGIN failed--compilation aborted at firsttry.pl line 94.
any idea what i could be doing wrong?
many thanks in advance
nico |