Hi

We have done this and it works ok - Receipe : Use the
logger.log(yourlogger.class,level,message[,exception]) function as shown
in Ceki tutorial. This reports the class,method and line ok

Hermod

-----Opprinnelig melding-----
Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sendt: 12. mars 2003 16:46
Til: [EMAIL PROTECTED]
Emne: DO NOT REPLY [Bug 17920] New: - Option to offset the stack frame
used in PatternLayout's file and line numbering


DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17920>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17920

Option to offset the stack frame used in PatternLayout's file and line
numbering

           Summary: Option to offset the stack frame used in
PatternLayout's
                    file and line numbering
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Layout
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


We have a large project with an existing logging framework, and are
moving over 
to using LOG4J for logging.  We are doing this by changing our existing
logging 
module to wrap LOG4J.

One disadvantage of wrapping LOG4J this way is that line numbers and
files 
printed using PatternLayout's %F and %L directives will now refer to the
line 
in our logging module that called LOG4J, as this is always constant in
our 
case, this information isn't very useful.

It would be useful if there was a configuraion option to offset the line
in the 
stack frame from where this information is collected to support systems
that 
make all calls to LOG4J from single wrapper.

For example, for a stack trace such as:

  java.lang.Throwable
    ...
    at org.apache.log4j.PatternLayout.format(PatternLayout.java:413)
    at org.apache.log4j.FileAppender.doAppend(FileAppender.java:183)
    at org.apache.log4j.Category.callAppenders(Category.java:131)
    at org.apache.log4j.Category.log(Category.java:512)
+   at other.logging.module.Logger.log(OtherLogger.java:33)
*   at callers.fully.qualified.className.methodName(FileName.java:74)

The line marked (*) could be used to produce location information, if
the 
stacktrace offset was 1, rather than the default line marked (+).

Dave.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that DnB cannot
accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to