Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^4: Import constants?

by DreamT (Pilgrim)
on Aug 05, 2010 at 08:49 UTC ( [id://853072]=note: print w/replies, xml ) Need Help??

in reply to Re^3: Import constants?
in thread Import constants?

I get
Can't locate auto/DBIx/Log4perl/st/ in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/local/share/perl/5.10.0/DBIx/Log4perl/ line 281
when running it, so mayme i'm missing something?

Replies are listed 'Best First'.
Re^5: Import constants?
by almut (Canon) on Aug 05, 2010 at 09:15 UTC

    Could you show the exact code that produces the problem?

    With the following test I can't replicate the issue:

    #!/usr/bin/perl -l use DBIx::Log4perl qw(:masks); $DBIx::Log4perl::LogMask = DBIX_L4P_LOG_OUTPUT | DBIX_L4P_LOG_INPUT; print $DBIx::Log4perl::LogMask;

    (prints '3', as expected)

      I used:
      use DBIx::Log4perl qw(:masks); $DBIx::Log4perl::LogMask = DBIX_L4P_LOG_OUTPUT | DBIX_L4P_LOG_INPUT; Log::Log4perl->init("myconfig.cfg"); $dbh = DBIx::Log4perl->connect($DSN, "user", "pass");
      log4perl.logger = FATAL, LOGFILE log4perl.appender.LOGFILE=Log::Log4perl::Appender::File log4perl.appender.LOGFILE.filename=logs/FATAL.TXT log4perl.appender.LOGFILE.mode=append log4perl.appender.LOGFILE.Threshold = ERROR log4perl.appender.LOGFILE.layout=PatternLayout log4perl.appender.LOGFILE.layout.ConversionPattern=[%r] %F %L %c - %m% +n log4perl.logger.DBIx.Log4perl=DEBUG, A1 log4perl.appender.A1=Log::Log4perl::Appender::File log4perl.appender.A1.filename=logs/OK.txt log4perl.appender.A1.mode=append log4perl.appender.A1.layout=Log::Log4perl::Layout::SimpleLayout
Re^5: Import constants?
by almut (Canon) on Aug 05, 2010 at 13:14 UTC

    From a quick look at the code, I would say try replacing line 277 in DBIx/Log4perl/

    $sth->_dbix_l4p_perl(2, # line 277 sub {Data::Dumper->Dump( [$res], ["fetchrow_hashref($h->{dbh_no}.$sth->{private_DBIx_st_no} +)"])}) if ($h->{logmask} & DBIX_L4P_LOG_OUTPUT);


    $sth->_dbix_l4p_debug($h, 2, # line 277 ...

    AFAICT, there is no method _dbix_l4p_perl in any of the related packages (while there are similarly named ones like ..._debug, ..._info, etc.).  No guarantees, though (untested).

      ...and of course it worked:-) Thanks a lot!
      Should I file a bug report to the author about this?
Re^5: Import constants?
by mje (Curate) on Aug 06, 2010 at 19:54 UTC

    That was a bug in DBIx::Log4perl and is fixed in 0.22 which I've just uploaded. I didn't see your thread even though I am a perl monk because your subject did not grab me and I don't have time to read every one - perhaps there is a lesson to be learnt there. The fix correctly identified elsewhere in this thread is trivial and a little embarrassing although I have to admit to not using the OUTPUT logging in my own projects.

      The subject did start out as something else - I wanted to learn how to use constants:) But I can see that v0.22 works "from scratch" after installing it on a new machine.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://853072]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 03:24 GMT
Find Nodes?
    Voting Booth?

    No recent polls found