#!/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 LEGALESE

Copyright 2003 by Mike Schilli, all rights reserved.
This program is free software, you can redistribute it and/or
modify it under the same terms as Perl itself.

=head1 AUTHOR

2003, Mike Schilli <m@perlmeister.com>
