DavidFerrington has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to use one additional level of logging above DEBUG - the Log::Log4Perl doc states there is a TRACE level, but I can't seem to get this to work.

if I call $logger->trace('...'); I get the Can't location object method "trace" via package ... error.
If I call $logger->log($TRACE,'...'); I get No priority given and it looks like $TRACE is not defined (but the other levels are).

Is this a bug in the documentation and TRACE is not actually valid?

-- David

Replies are listed 'Best First'.
Re: Log::Log4Perl trace method missing
by Anonymous Monk on Jan 21, 2010 at 17:07 UTC
    Is this a bug in the documentation and TRACE is not actually valid?

    Works for me.

    #!/usr/bin/perl -- use strict; use warnings; use Log::Log4perl 1.26 qw(:easy); TRACE("UNSEEN"); Log::Log4perl->easy_init($ERROR); TRACE("ALSO UNSEEN"); Log::Log4perl->easy_init($TRACE); TRACE("SEEN"); Log::Log4perl->get_logger->trace("ALSO SEEN"); __END__ 2010/01/21 09:07:26 SEEN 2010/01/21 09:07:26 ALSO SEEN
      hmmm, might be because I'm using 5.8.8 and a 1.04 Log::Log4Perl and I can't do anything about that, since this is what we have in the company and I can't get a later version.
      -- David