From: Mike S. <m...@pe...> - 2009-02-26 00:42:56
|
On Tue, 24 Feb 2009, Robert Jacobson wrote: > Those are mostly the expected values from the Layout I specified > (time, log level, script name, hostname, PID, ?????, message). That's peculiar ... what does your layout look like? It's hard to diagnose the problem without code that reproduces it, can you post a stripped-down version of your appender? -- Mike Mike Schilli m...@pe... > 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 ....'; > |