Weblog

All | Personal | Sun
« Previous day (Mar 14, 2006) | Main | Next day (Mar 15, 2006) »
20060315 Wednesday March 15, 2006

How to enable logging in file for Java Web Start applications I'm working on application client that is launched via Web Start today. The client application was downloaded but there was some issue with execution. Therefore, I enabled Java Console in browser. The console is nice but it's closed suddenly when application can't start and execution is finished. This feature doesn't help me to find out the issue.
Then, I remembered for configuration of Logger for JRE. It's very simple configured via logging.properties file that is located in lib directory under your JRE home. By deafult, only ConsoleHandler is used and you can very simple add FileHandler. Add java.util.logging.FileHandler in handlers property. Then you can specify options for the FileHandler like file pattern, limit of write in bytes, number of files and formatter. The formattter is XML by deafult. However, this type isn't very well arranged for reading. I used SimpleFormatter for tracking exceptions in my client.
After these changes you can run application client again and open log file that is $HOME/javaX.log by default for FileHandler. I realized that a bug isn't in my application but in Glassfish itself. I reported it as the issue 406. I hope that I will win a iPod. :-) Posted by pblaha ( Mar 15 2006, 05:03:08 PM CET ) Permalink

Calendar

RSS Feeds

Search

Links

Navigation

Referers

Older blog entries