On Tue, 13 May 2008, Erskine, Thomas (IT) wrote: > While warp_message is indeed an appender setting, if you have two > appenders, one with warp_message=0 and one without, then you'll get > the mess I got: the one with will work fine and will have access to > extra args separately, but the one without will mash the args into > a single message. > > Perhaps I ought to have said that, while it's possible to have appenders > with warp_message=0 and those without in the same setup, it's not > _useful_ as the result will be a mess.
It's a dilemma: We're hiding probes in the code that should work for all appenders, and yet some appenders interpret them differently. Note that the Log4perl configuration is supposed to be independent of the code. Any person, even those unfamiliar with your code, should be able to define a Log4perl config file from scratch to run it with. I'm admitting that this is a stretch (and what L4p does deviates from the strict Log4j standard) but we've found it useful for database appenders, for example. I'll be the first to admit, though, that this isn't a 100% clean solution. I guess you could find arguments either way, but I feel that mashing arguments as a default is reasonable and provides predictable results. > On a completely different topic, while making a Null appender (which > discards everything), I noticed that it doesn't seem possible to make > the initializer shut up about it not having a layout. Even though > I added in code to the new to cause it to inflict the NoopLayout to > itself. It just seemed that I shouldn't have to provide configuration > for a Null appender, since it isn't doing anything. Instead, I have > to say: > log4perl.xxx.appender=Null > log4perl.xxx.layout=NoopLayout > log4perl.xxx.warp_message=0 > I understand that you're just (properly) checking that people haven't > made a stupid mistake in forgetting the layout. Exactly, catching stupid errors has precedence over making slick code short. :) -- Mike Mike Schilli [EMAIL PROTECTED] ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ log4perl-devel mailing list log4perl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/log4perl-devel