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. :-)
Comments:

Post a Comment:
Comments are closed for this entry.
About

pblaha

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks