Skip to main content

Would anyone like to recommend a java.util.logging viewer?

11 replies [Last post]
coxcu
Offline
Joined: 2003-06-11

Hi,

I'm looking for a java.util.logging viewer. Would anyone like to recommend one? Is there anything that would allow me to log using the java.util.logging API, yet use Log4J tools?

With log4j, I can use Chainsaw, LogFactor5, or Lumbermill.

Chainsaw
http://logging.apache.org/log4j/docs/images/chainsaw-fullscreen.jpg

Lumbermill
http://traxel.com/img/lumbermill.png

Thanks,
Curt

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
centeractive
Offline
Joined: 2012-09-07

Hi,

Probably you already found a solution, if not I would recommend Retrospective Log Analyzer: www.retrospective.centeractive.com

Regards,
Magdalena

Krzysztof_
Offline
Joined: 2012-06-06

I reccomend you using http://code.google.com/p/otroslogviewer.

Krzysztof.

southc
Offline
Joined: 2006-02-27

while this appears to set up correctly (change class name of decoder when you add a receiver from XMLDecoder to UtilLoggingXMLDecoder) and accept the socket connection and such, I get an exception when it tries to read the XML in the packet being sent:

ERROR org.apache.log4j.net.SocketNode - Exception opening ObjectInputStream to Socket[addr=/192.168.0.101,port=53934,localport=42999]
java.io.StreamCorruptedException: invalid stream header
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)

This is using Java6 (beta) for the program creating the log messages, not sure if that has anything to do with it, but looking at the packets with WireShark shows what looks like valid XML data, but it must be in a format that doesn't match what Chainsaw is expecting.

NOTE:
I could only get Chainsaw to run with Java 5 on OS X and only with the UNIX download with the shell script.

Lumbermill would run in both Java 5 and Java 6 (beta), but would NPEs when I tried to add a New Client or New Server, so never got it working.

Time to write my own...

pocketdevel
Offline
Joined: 2009-09-21

Hi,

if you use Eclipse you could try the EDevTools LogViewer (http://edevtools.sourceforge.net/). It displays the log entry in a table and colors them by level.

Chris

sdeboy
Offline
Joined: 2003-06-12

Chainsaw can process events generated by util.logging.

- It can read regular text log files by configuring Chainsaw to use a LogFilePatternReceiver.

- It can read log files created using XMLFormatter from the file-open menu

- It can accept events sent over the network (SocketHandler formatted using XMLFormatter) by configuring Chainsaw to use an XMLSocketReceiver configured with a UtilLoggingXMLDecoder.

coxcu
Offline
Joined: 2003-06-11

sdeboy,

Could you provide or point to some more detailed instructions for how to use Chainsaw with java.util.logging?

Strangely, Chainsaw doesn't appear to have any mechanism for dynamically increasing or decreasing the log level at runtime. Am I missing it?

I could understand this limitation, if it was intended solely for browsing log files that were produced by terminated applications. Judging by the tutorial, however, it is very much targeted at live applications, so the omission is puzzling. I guess the excellent JConsole could be used to modify log levels.

Thanks,
Curt

atehrani
Offline
Joined: 2004-01-14

People actually use the java.util.logging API? Log4j is still superior to it. They should have just rolled Log4j into the JDK.

coxcu
Offline
Joined: 2003-06-11

Yes, people use java.util.logging.

Why do you say Log4J is superior? Is is because of the API or tool support? I think Log4J has a slight API edge, but java.util.logging makes up for it with simpler deployment.

One external jar isn't a big deal, if it makes the number of third-party jars go from 25 to 26. If it makes the number of third-party jars go from 0 to 1, it's something I try to avoid.

Writing to java.util.logging instead of Log4J also has these advantages:
- all libraries just supporting the same JRE is more likely than all libraries supporting the same Log4J version, too
- less likely to have classloader related logging problems

firefight
Offline
Joined: 2006-05-05

You can also see and configure log message from classes you didn't write, like java.*

asjf
Offline
Joined: 2003-06-10

i had a look around for one in 2004 and could only find one (it was quite early in its development so not suitable)

i'm guessing from the silence this post has received that the situation hasn't changed?

giaros
Offline
Joined: 2007-11-09

Take a look to http://sourceforge.net/projects/jlogviewer/
It's a lightweight GUI to easily view the java application logs generated by the "java.util.logging" package. The user interface provides facilities in order to filter, to sort and to find the log records