I'm looking for a log viewer with similar capablilties as Chainsaw, in which I can tail Glassfish log files over for instance SSH/SCP. Does anyone know if such a tool exist?
8 Answers
OtrosLogViewer user VFSFileSystems and can load logs from remote server (ftp, sftp, smb, http). It supports java.util.logging.XMLFormatter and java.util.logging.SimpleFormatter. See: http://code.google.com/p/otroslogviewer/

- 161
- 1
- 3
-
2This tool is just great. I wish I could upvote twice :) – Denys Kniazhev-Support Ukraine Jul 13 '11 at 09:20
-
You have to create a pattern for glassfish logs. I added an answer for how that is done since the comments don't format well. – Alan B. Dee Dec 16 '11 at 19:01
I have started looking at OtrosLogViewer and found recent updates to it require changes to the pattern file format for GlassFish. Information is from this issue.
Here is the pattern definition that works for me:
name=GlassFish Pattern
type=log4j
pattern=[#|TIMESTAMP|LEVEL|PROP(A)|LOGGER|_ThreadID=PROP(B);_ThreadName=THREAD;|MESSAGE
dateFormat=yyyy-MM-dd'T'HH:mm:ss.SSSZZZZ
charset=UTF-8
customLevels=SEVERE=FATAL,WARNING=WARN,CONFIG=INFO,FINE=DEBUG,FINER=TRACE,FINEST=TRACE,INFO=INFO
I am using release 2012-04-25 of OtrosLogViewer. Until the problem of parsing the trailing \n|#]
is solved they will pollute the messages a bit.
Edited: The fourth field is the logger name.

- 1,209
- 1
- 14
- 18
OtrosLogViewer is nice but you have to setup the pattern for glassfish logs.
Simply create a file in ${OTROS_ROOT}/plugins/logimporters/glassfish.pattern with:
type=log4j
pattern=[#|TIMESTAMP|LEVEL|PROP(A)|CLASS|_ThreadID=PROP(B);_ThreadName=THREAD;|MESSAGE|#]
dateFormat=yyyy-MM-ddTHH:mm:ss.SSSZZZZ
name=glassfish parser
charset=UTF-8

- 5,490
- 4
- 34
- 29
Try Retrospective Log Analyzer -> http://www.retrospective.ch/
It can search over files and tail files on a remote server using SSH (on the local disks as well). It does not have to download the content of the file to search over it (like Otros). Everything is done ad-hoc on the server (in a read-only manner - so that the production servers are safe).
It can also do the line and column split automatically (it will parse the log file and generate the line and column split pattern that is compliant with log4j so that your log entries are split correctly) - you don't have to guess/type it yourself.
Finally, it can also parse the date, so that you can search over local/remote files using a date filter (really useful if you have a lot of old files in one folder).
DISCLAIMER: I am one of the developers that work on Retrospective. This post is not an advert, but a personal statement based on my opinion and experience. I have tested all the proposed solutions that are mentioned in this thread and I am convinced that Retrospective is the best solution to this problem.

- 1,612
- 2
- 13
- 20
I have put together something that allows me to use java.util logging with GlassFish and Chainsaw. Sources etc. here: http://blog.cotopia.com/2009/10/sending-glassfish-javautil-log-records.html
Does Chainsaw with the VFS plugin not do that?

- 36,219
- 10
- 45
- 60
-
-
-
Looks great, but it apperars that the server I currently use does not support SFTP, only SCP. – Kristian Oct 09 '08 at 14:00
From other post:
- Configure putty to write out a log file from the connection.
- Do the log analysis against the putty log file.
VFSLogFilePatternReceiver uses Jakarta Commons-VFS, so it supports SFTP and SCP. See: http://commons.apache.org/vfs/filesystems.html#SFTP

- 1,728
- 11
- 11