Log-Log4perl

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

             documentation in the Limiter composite appender. Fixed docs
             and added C<appender_method_on_flush> parameter to support
             appender flush calls by the limiter.
   *    (ms) [rt.cpan.org #79960] Fabrice Gabolde asked for %X{x} to be 
             interpolated as NULL for the database appender if its value is 
             undef. The DBI appender now inits PatternLayout with the 
             undef_column_name parameter set to undef (defaults to "[undef]").
   *    (ms) Updated license/copyright/author sections in all files using 
             licensizer and .licensizer.yml.
   *    (ms) Skipped log file recreation test on Win32 as it won't remove
             busy files anyway.

1.38 (2012/09/23)
   *    (ms) Bob Kleemann reported that logdie() in wrapper classes
             printed incorrect caller lines. Fixed by adding 
             caller_depth_offset() utility to Log4perl.pm.
   *    (ms) Meir Guttman reported a use case for logging messages
             with dynamic levels on log4perl-devel@lists.sourceforge.net.
             Added to manual page.
   *    (ms) Implemented suggestion by Neil Hooey to check for and report
             undefined message elements before they're assembled in Appender.pm

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

=item autoflush

C<autoflush>, if set to a true value, triggers flushing the data
out to the file on every call to C<log()>. C<autoflush> is on by default.

=item syswrite

C<syswrite>, if set to a true value, makes sure that the appender uses
syswrite() instead of print() to log the message. C<syswrite()> usually
maps to the operating system's C<write()> function and makes sure that
no other process writes to the same log file while C<write()> is busy.
Might safe you from having to use other synchronisation measures like
semaphores (see: Synchronized appender).

=item umask

Specifies the C<umask> to use when creating the file, determining
the file's permission settings.
If set to C<0022> (default), new
files will be created with C<rw-r--r--> permissions.
If set to C<0000>, new files will be created with C<rw-rw-rw-> permissions.

t/017Watch.t  view on Meta::CPAN

  
  ok(kill('USR1', $$), "sending signal");
  $logger->info("test1");
  $logger2->info("test1");
  ok(-f $testfile, "recreate_signal - testfile reinstated");
  ok(-f $testfile2, "recreate_signal - testfile2 reinstated");
};


SKIP: {
  skip "Removing busy files not supported on Win32", 1 if is_like_windows();

    # ***************************************************************
    # Check the 'recreate' feature with check_interval
    
    trunc($testfile);
    my $conf3 = <<EOL;
    log4j.category.animal.dog   = INFO, myAppender
    
    log4j.appender.myAppender          = Log::Log4perl::Appender::File
    log4j.appender.myAppender.layout   = Log::Log4perl::Layout::SimpleLayout

t/017Watch.t  view on Meta::CPAN

    open (LOG, $testfile) or die "can't open $testfile $!";
    is(scalar <LOG>, "INFO - test2\n", "recreate before 2nd write");
    close LOG;
    unlink "$testfile.old";
};

# ***************************************************************
# Check the 'recreate' feature with moved/recreated file

SKIP: {
  skip "Moving busy files not supported on Win32", 1 if is_like_windows();

    trunc($testfile);
    my $conf3 = <<EOL;
    log4j.category.animal.dog   = INFO, myAppender

    log4j.appender.myAppender          = Log::Log4perl::Appender::File
    log4j.appender.myAppender.layout   = Log::Log4perl::Layout::SimpleLayout
    log4j.appender.myAppender.filename = $testfile
    log4j.appender.myAppender.recreate = 1
    log4j.appender.myAppender.recreate_check_interval = 1



( run in 0.285 second using v1.01-cache-2.11-cpan-87723dcf8b7 )