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]
