On Mon, 13 Dec 2004, tod...@ex... wrote:
> Im trying to set dynamic PallernLayouts depending on the log level called.
> ...
> L::L4p::Logger::create_custom_level("ENTER", "FATAL");
> L::L4p::Logger::create_custom_level("EXIT", "ENTER");
Hmm, seems like you're using levels not as message priorities but to
trigger certain actions in your appender. This way, you'll get some
broken XML if you set the log level to ENTER, etc., so I'd recommend
not doing that.
How about this:
1) Write your own XML appender (see FAQ), featuring an enter() and and
exit() method, which just set the state within the appender
2) On log(), have the appender store the message(s).
3) On exit(), have the appender format all messages as XML and write them
out.
4) At the beginning and end of every function, place calls to trigger
YourAppender->enter(), YourAppender->exit();
5) In between, use Log4perl's regular $logger->debug("..."); etc. calls.
This would fit better into L4p's architecture. What do you think?
-- Mike
Mike Schilli
m...@pe...
|