On Mon, 23 Feb 2009, Ronald Fischer wrote: > I see, and I guess get_request_name must be in package main so that > the logging package can find it?
Either that or you call the fully qualified name, Foo::Bar::get_request_name. > 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? Looks perfect to me. > 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. Everything you can do in a configuration file can be done in code with the Log4perl API, problem is just that it might get confusing if you're trying to figure out what's going on by looking at the configuration file, while application code is pulling the rug under it :). -- Mike Mike Schilli m...@perlmeister.com ------------------------------------------------------------------------------ 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