Hi Ceki, thanks for your response. My comments:
1. callerFQCN: what you said makes sense. My work around was due to the fact that the wrapper class wasn't mine, but an Avalon Project's Log4JLogger. So the bug is really an Avalon bug...I'll submit it to them. thanks! 2. Level/PatternConverter: I don't really agree with coupling pattern converters and logging levels. These two things are orthogonal, and should remain so even with custom PatternConverters. Going back to my example, I might want the full details at DEBUG Level. Your proposal would suggest that I define a %lineDebug conversion word that displays the line number only when in DEBUG mode. But then I might decide that I want full detail at INFO Level as well just for a little while until I figure out what's going on. Would I need to define yet another conversion word called %lineINFO in order to do this? I shouldn't have to define a pattern converter for each (conversion word x logging level) combination... So with the "orthogonal" approach, a properties file might look like this: log4j.appender.stdoutAppender.layout.ConversionPattern=[%c] - %p [%t]: %m%n log4j.appender.stdoutAppender.layout.ConversionPattern.DEBUG=[%c] - (%F:%L) %p [%t]: %m%n In this example, there's a general conversion patter applicable to all levels, with an override for DEBUG mode. If I then changed my mind and wanted the same logging details for INFO Level and higher, I would just change DEBUG to INFO in the second line. Thoughts? Cheers, -Ogi. -----Original Message----- From: Ceki G�lc� [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 11:31 AM To: Log4J Developers List Subject: Re: how to propose and submit new features? Hello Ognjen, Please see my comments below. At 05:57 PM 4/20/2004, Ognjen Kavazovic wrote: >Hello, > >I would like to propose and contribute a couple of relatively minor features >to the current code base, but am not finding any documentation as to how I >should go about getting the features approved and then submitting the patch. >Could someone point me to the right doc or let me know what I should do in >order to have the following included in the soonest release possible: Contacting this list and explaining what you have in mind was the right thing to do. >1. Being able to specify a wrapper-class for the log4JLogger Logger. For >example, in the Avalon framework there is a Log4JLogger class which wraps a >real log4j logger, and all calls are delegated via the Avalon logger. This >makes the conversion characters %C, %F, %L, %l, and %M useless as they >always resolve to the same class and line number, i.e. the Avalon >Log4JLogger wrapper-class is always the caller. It's a trivial fix to allow >the user to specify the wrapper-class in the properties file and >programatically, in order to identify the existence of such a wrapper class. >It is possible to work-around this by using a custom Logger and overiding >the forcedLog method, but it seems that this is general enough to be >included in the main code base. Your wrapper should use the generic Logger.log() method. The signatures is log(String callerFQCN, Priority level, Object message, Throwable t) where callerFQCN is the fully qualified name of the calling class. There is really no need to override forceLog method. >2. Being able to specify ConversionPattern PER logging Level. The docs make >it very clear that some conversion chars (esp. the ones listed above) are >very expensive and should be avoided. However, some of them can also be very >useful while debugging, so it would make very good sense to be able to >specify one detailed ConversionPattern for the DEBUG logging Level, and one >generic, less-expensive pattern for the normal INFO logging, for example. In log4j version 1.3, it will be very easy to add your own pattern converters. See https://www.qos.ch/logging/PatternLayout.html for more details. Thus, you could create your own pattern converters, say $Cx, %Fx, $Lx, and %Mx, that extract location information only if the level is higher than debug. I hope this makes sense. If it does not, please shout. >Cheers, >-Ogi. > >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Sent: Tuesday, April 20, 2004 5:04 AM >To: [EMAIL PROTECTED] >Subject: cvs commit: >logging-log4j/tests/src/java/org/apache/log4j/scheduler - New directory > > >ceki 2004/04/20 03:03:58 > > logging-log4j/tests/src/java/org/apache/log4j/scheduler - New directory > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] -- Ceki G�lc� For log4j documentation consider "The complete log4j manual" ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
