Bill, The method I posted is part of a wrapper class that we use for log4j Category. We did this so that we could buffer the calling code from specific implementations, so if in the unlikely event we wanted to replace log4j, we could just change the wrapper implementation and none of the calling code. There are pros and cons to this that I won't go into right now.
But, to answer your question, the FQCN parameter passed to the constructor for LoggingEvent should take care of the location info issues. In our code it is set to the class name of the wrapper class. Log4j uses this name when working back through the location info stack. I am looking at some Chainsaw output right now that appears to be displaying the correct location info for places where we call this method. What are you using for the FQCN parameter? -Mark -----Original Message----- From: Bill Rebey [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 11:24 AM To: Log4J Users List Subject: RE: Forced logging Thanks, Mark! I can at least get the desired log messages to come out now, but 90% of the purpose of using log4j is to get caller source location information (Class name, Method name, Source line number), which this appears not to do, so it doesn't quite work right. Furthermore, I implemented this via a wrapper method. Even if I DO get source location info, won't every log statement report itself as being at the same line # in the same source module, specifically, the sounce and line of the wrapper? Bill -----Original Message----- From: Mark Womack [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 12:57 PM To: 'Log4J Users List' Subject: RE: Forced logging Instead of using forcedLog, you can use something like this: public void status(Object message, Throwable t) { category.callAppenders(new LoggingEvent(FQCN, category, Priority.INFO, message, t)); } The above is a method we have to print "status" messages regardless of current logging settings. But beware this road. People will start using it and then you'll be stuck with it. They are the equivalent of System.out.println(), which is what we were trying to remove in the first place...:-) -Mark -----Original Message----- From: Bill Rebey [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 9:36 AM To: Log4J Users List Subject: Forced logging I want to log certain messages regardless of the current Priority level. How do I do this? I thought I could use "Category.forcedLog (...)", but it's protected. What should I use instead? Thanks for the help! Bill Rebey ======================= Confidentiality Statement ======================= The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL and exempt from disclosure under applicable law. If you have received this message in error, you are prohibited from copying, distributing, or using the information. Please contact the sender immediately by return e-mail and delete the original message from your system. ===================== End Confidentiality Statement ===================== -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> ======================= Confidentiality Statement ======================= The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL and exempt from disclosure under applicable law. If you have received this message in error, you are prohibited from copying, distributing, or using the information. Please contact the sender immediately by return e-mail and delete the original message from your system. ===================== End Confidentiality Statement ===================== -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>