1Appender::Screen(3) User Contributed Perl Documentation Appender::Screen(3)
2
3
4
6 Log::Log4perl::Appender::Screen - Log to STDOUT/STDERR
7
9 use Log::Log4perl::Appender::Screen;
10
11 my $app = Log::Log4perl::Appender::Screen->new(
12 stderr => 0,
13 utf8 => 1,
14 );
15
16 $file->log(message => "Log me\n");
17
19 This is a simple appender for writing to STDOUT or STDERR.
20
21 The constructor "new()" take an optional parameter "stderr", if set to
22 a true value, the appender will log to STDERR. The default setting for
23 "stderr" is 1, so messages will be logged to STDERR by default.
24
25 If "stderr" is set to a false value, it will log to STDOUT (or, more
26 accurately, whichever file handle is selected via "select()", STDOUT by
27 default).
28
29 Design and implementation of this module has been greatly inspired by
30 Dave Rolsky's "Log::Dispatch" appender framework.
31
32 To enable printing wide utf8 characters, set the utf8 option to a true
33 value:
34
35 my $app = Log::Log4perl::Appender::Screen->new(
36 stderr => 1,
37 utf8 => 1,
38 );
39
40 This will issue the necessary binmode command to the selected output
41 channel (stderr/stdout).
42
44 Copyright 2002-2009 by Mike Schilli <m@perlmeister.com> and Kevin Goess
45 <cpan@goess.org>.
46
47 This library is free software; you can redistribute it and/or modify it
48 under the same terms as Perl itself.
49
50
51
52perl v5.12.2 2010-08-31 Appender::Screen(3)