|
From: Robert J. <yad...@sn...> - 2009-02-24 17:40:07
|
Robert Jacobson wrote:
> If I add equivalent code to my existing conditional for the definition
> of errorappender, i.e.:
>
> if ($self->{errorappender}) {
> # Pass back the appender to be synchronized as a dependency
> # to the configuration file parser
> push @{$p{l4p_depends_on}}, $self->{errorappender};
> push @{$p{l4p_post_config_subs}}, sub { $self->post_init() };
> }
>
> Then I get this error from Log::Log4perl::Appender::DBI:
>
> Log4perl: DBI appender failed to reconnect to database after 1 attempt
> at init_and_watch.pl line 10
I added some debug to DBI.pm and found that when I add the "depends_on"
code, the sub in DBI query_execute gets called with extra arguments. I
turned on the warn to print out the DBI::errstr and found that it isn't
really a connection error, it's a failure to execute the DBI statement:
Exe: failed: called with 7 bind variables when 6 are needed at
.../Log/Log4perl/Appender/DBI.pm line 159.
(line number different because of my local edits to DBI.pm)
Adding a "Dumper" for qmarks:
$VAR1 = '2009-055/17:35:41';
$VAR2 = 'INFO';
$VAR3 = 'component.pl';
$VAR4 = 'ansdev2';
$VAR5 = '25227';
$VAR6 = 'ARRAY(0x813274c)';
$VAR7 = 'Starting ....';
Those are mostly the expected values from the Layout I specified (time,
log level, script name, hostname, PID, ?????, message).
Where the heck did that "ARRAY" string come from? I checked using
ref(); it really is a string of characters and not an actual array ref.
--
Rob
|