Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Other JSE/JEE APIs and the fly likes logging runtime exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "logging runtime exceptions" Watch "logging runtime exceptions" New topic
Author

logging runtime exceptions

M. Gagnon
Ranch Hand

Joined: Feb 18, 2004
Posts: 68
I am using a java.util.logging.Logger object to log caught exceptions with calls to its severe() method. However, my hosting service does not allow users access to the Resin logs on the server. Is there a way to configure the Logger object to log runtime exceptions automatically to my own log file?

Thanks
clio katz
Ranch Hand

Joined: Apr 30, 2004
Posts: 101
i normally use log4j - where this would be easy. however it appears java logging has self-similar facilities - to (1) init some kind of io handler, (2) associate the handler with the root logger, and (3) configure the new logger

a slightly altered sun example:




NOTE: _getLogger-by-name doesn't work this smoothly in log4j:-)


hth
M. Gagnon
Ranch Hand

Joined: Feb 18, 2004
Posts: 68
Hmmm. It seems the only way to use the Java logging API is to call the methods exclusively in your code. I have not found a way to log runtime exceptions automatically in a programmer-specified log file. If anyone knows how to do this, please let me know. In the meantime, I'll have to switch back to the logging framework put out by bitfactory.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logging runtime exceptions