On Fri, 20 Feb 2009 10:41 -0800, "Mike Schilli" <m...@perlmeister.com> wrote: > On Fri, 20 Feb 2009, Ronald Fischer wrote: > >> log4perl.logger = DEBUG, FooApp, BarApp, AnotherAppender > > > > This is valid Perl code????? So I have to the left of the assignment a > > catenation, and to the right the comma operator? > > Of course not, it's l4p config syntax. > > >> # ... > >> log4perl.appender.AnotherAppender.filename = \ > >> sub { "mylog." . get_request_name() . ".log" } > > > > Here too I don't understand the syntax. > > The right-hand side of an assignment in l4p config syntax can be a > perl code reference.
I see, and I guess get_request_name must be in package main so that the logging package can find it? There are two (hopefully minor) problems left: There are times where there is no request being processed, but still logging occurs. One solution would be to have get_request_name() in this case return a dummy name (say: '_none_'), which would result in a file mylog._none_.log, which I then simply can discard. But maybe you have a more elegant solution for this? The other problem is that I would strongly prefer a solution without l4p configuration file. The reason is that one requirement for our application was "one config file only", so we have an application specific configuration file, so I'm using easy_init to initialize the logging. Although I can clearly see advantages of using a separate config file for logging, it would violate a requirement for this project. Sure, maybe I can convince the customer to change this requirement, but your solution could be done interally, I would be happier. Ronald -- Ronald Fischer <rona...@eml.cc> + If a packet hits a pocket on a socket on a port, + and the bus is interrupted and the interrupt's not caught, + then the socket packet pocket has an error to report. + (cited after Peter van der Linden) ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ log4perl-devel mailing list log4perl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/log4perl-devel