aspose file tools
The moose likes Beginning Java and the fly likes How to pass exception as one of the object[] when doing logging? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "How to pass exception as one of the object[] when doing logging?" Watch "How to pass exception as one of the object[] when doing logging?" New topic
Author

How to pass exception as one of the object[] when doing logging?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 550
Hi,

I am trying to understand is it possible to have functionality of both these methods in one place? for example have a formatted message with the parameters and also have the exception being logged along with the message?



Thank you.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 5893
    
    6

raminaa niilian wrote:Hi,

I am trying to understand is it possible to have functionality of both these methods in one place? for example have a formatted message with the parameters and also have the exception being logged along with the message?



Thank you.


If those are all the methods and you can't add any, then it's not possible. Otherwise, if you control that class, you can add a signature that takes level, msg, params, thrown.

Of course, in lieu of calling


you can just call String.format() to format your message and then call

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to pass exception as one of the object[] when doing logging?
 
Similar Threads
java.util.Logger creating multiple log files
Runaway Thread
Logging "FINEST" messages using java Logger
Not so simple NPE
Issue with JBoss logging for different jboss instances running on same machine