/usr/share/doc/liblog-log4perl-perl/examples/override_appender is in liblog-log4perl-perl 1.29-1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #!/usr/bin/perl
######################################################################
# override_appender -- 2003, Mike Schilli <m@perlmeister.com>
######################################################################
# Overrided the appender layout after defining it in the conf file.
######################################################################
use strict;
use warnings;
my $VERSION = "0.01";
our $CVSVERSION = '$Revision: 1.1 $';
use Log::Log4perl qw(:easy);
Log::Log4perl->init(\ <<'EOT');
log4perl.category = WARN, Screen
log4perl.appender.Screen = Log::Log4perl::Appender::Screen
log4perl.appender.Screen.layout = \
Log::Log4perl::Layout::PatternLayout
log4perl.appender.Screen.layout.ConversionPattern = %d %F{1} %L> %m %n
EOT
my $appenders = Log::Log4perl->appenders();
my $layout = Log::Log4perl::Layout::PatternLayout->new("%m %m%n");
$appenders->{Screen}->layout($layout);
WARN("test message");
__END__
=head1 NAME
override_appender - Try to change an appender's layout
=head1 SYNOPSIS
override_appender
=head1 DESCRIPTION
Change an appender's layout after it has been defined in the configuration
file.
=head1 COPYRIGHT AND LICENSE
Copyright 2002-2009 by Mike Schilli E<lt>m@perlmeister.comE<gt>
and Kevin Goess E<lt>cpan@goess.orgE<gt>.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
|