JNLP & Logging

I took a look at JNLP. I have made some choices about loading resources that wont allow mindshare to work as a JNLP app until they are fixed. Basically this was a testing convenience. I can set the working directory on each instance to be different and everything will be stored in that directory. This is great when you are running two or three peers on the same machine as a test. JNLP puts things in strange places and renames resources. The ‘right’ thing to do is to store everything in the users home directory. This would only allow one peer per user to run. The right solution it to allow the app to take command line parameters to put it into testing mode. This would probably take a day or more to fix so I wont get JNLP working any time soon.

I switched to Log4J from Java’s built in logging API. I am very happy with the switch but the log window in the app has broken. What I really want is a coloured log output in the log window. Something like this:

<DEBUG> this is a debug message
<INFO> this is a info message
<WARN> this is a warning message
<ERROR> this is a error message
<FATAL> this is a fatal message

 This would make debugging at any location just a bit easier. The output would be in HTML of course and you could save the logs. Trouble is there appears to be no off the shelf solution for hooking up a log appender to a JTextPane. i wrote the Layout in about 10 minutes though. I may take another crack at this tonight because I really like the idea of being able to read the logs anywhere.



Comments are closed.