PodMaster, I humbly thank you for your prompt reply.
Module id = Log::Log4perl INST_VERSION 0.41
Upgrading seems to have no impact on current issue.
PodMaster: what you've posted pretty much works as it should
I agree. I ran your code and it worked as expected. Except when it comes to Apache/mod_perl/mason components. Has anyone successfully used Log::Log4perl in a similar setting?
index.mas:
my $log = MyLogger::->new("apache");
$log->fatal("This should be in the APACHE log");
my $retval = database::do_some_logging();
$log->fatal("This should be in the APACHE log");
database.pm:
my $log = MyLogger::->new("database");
sub do_some_logging { $log->warn("This should appear in DATABASE log."
+); }
database.log:
[empty]
apache.log (edited for readability)
FATAL> This should be in the APACHE log
WARN> This should appear in DATABASE log.
FATAL> This should be in the APACHE log
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.