Log-Log4perl

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    * (ms) Removed Log::Dispatch dependency, added standard 
           Log::Log4perl::Appender appenders File and Screen. 
           Log::Dispatch is still supported for backwards compatibility
           and special purpose appenders implemented within this hierarchy.

0.32 05/17/2003
    * (ms) Added fix to Makefile.PL to compensate for MakeMaker bug
           in perl < 5.8.0, causing man pages below Log::Log4perl::Config 
           not to be installed. Thanks to Mathieu Arnold <mat@mat.cc> 
           for bringing this up.
    * (ms) 0.31 had a Win32 test suite glitch, replaced getpwuid() 
           (not implemented) by stat() for Safe test.

0.31 05/08/2003
    * (kg) fixed bug Appender::DBI where it was consuming the message
           array before other appenders could get to it
    * (ms) changed config_and_watch to ignore clock differences between
           system time and file system time (helpful with skewed NFS 
           systems). Added Log::Log4perl::Config::Watch.
    * James FitzGibbon <james.fitzgibbon@target.com>: Added support for
           optionally restricting eval'd code to Safe compartments. 

README  view on Meta::CPAN

    Log::Log4perl::Config->allowed_code_ops_convenience_map(), then the
    allowed opcodes are set according to the value defined in the map. If
    this is confusing, consider the following:

     use Log::Log4perl;
 
     my $config = <<'END';
      log4perl.logger = INFO, Main
      log4perl.appender.Main = Log::Log4perl::Appender::File
      log4perl.appender.Main.filename = \
          sub { "example" . getpwuid($<) . ".log" }
      log4perl.appender.Main.layout = Log::Log4perl::Layout::SimpleLayout
     END
 
     $Log::Log4perl::Config->allow_code('restrictive');
     Log::Log4perl->init( \$config );       # will fail
     $Log::Log4perl::Config->allow_code('safe');
     Log::Log4perl->init( \$config );       # will succeed

    The reason that the first call to ->init() fails is because the
    'restrictive' name maps to an opcode mask of ':default'. getpwuid() is
    not part of ':default', so ->init() fails. The 'safe' name maps to an
    opcode mask of ':browse', which allows getpwuid() to run, so ->init()
    succeeds.

    allowed_code_ops_convenience_map() can be invoked in several ways:

    allowed_code_ops_convenience_map()
        Returns the entire convenience name map as a hash reference in
        scalar context or a hash in list context.

    allowed_code_ops_convenience_map( \%map )
        Replaces the entire convenience name map with the supplied hash

lib/Log/Log4perl.pm  view on Meta::CPAN

Log::Log4perl::Config-E<gt>allowed_code_ops_convenience_map(), then the
allowed opcodes are set according to the value defined in the map. If this
is confusing, consider the following:

 use Log::Log4perl;
 
 my $config = <<'END';
  log4perl.logger = INFO, Main
  log4perl.appender.Main = Log::Log4perl::Appender::File
  log4perl.appender.Main.filename = \
      sub { "example" . getpwuid($<) . ".log" }
  log4perl.appender.Main.layout = Log::Log4perl::Layout::SimpleLayout
 END
 
 $Log::Log4perl::Config->allow_code('restrictive');
 Log::Log4perl->init( \$config );       # will fail
 $Log::Log4perl::Config->allow_code('safe');
 Log::Log4perl->init( \$config );       # will succeed

The reason that the first call to -E<gt>init() fails is because the
'restrictive' name maps to an opcode mask of ':default'.  getpwuid() is not
part of ':default', so -E<gt>init() fails.  The 'safe' name maps to an opcode
mask of ':browse', which allows getpwuid() to run, so -E<gt>init() succeeds.

allowed_code_ops_convenience_map() can be invoked in several ways:

=over 4

=item allowed_code_ops_convenience_map()

Returns the entire convenience name map as a hash reference in scalar
context or a hash in list context.



( run in 0.358 second using v1.01-cache-2.11-cpan-8d75d55dd25 )