Some of you may recall my earlier experiences with “Ganymede”:http://sourceforge.net/projects/ganymede/ were “less that successful(magpiebrain – Ganymede – Log4J Logging inside eclipse)”:http://www.magpiebrain.com/archives/000087.html. To recap Ganymede is a plugin for eclipse that receives messages sent from Log4J. My problems revolved around the complete lack of documentation to explain how to get the thing to work. Anyway, “Will Sargent(Will Sargent – Terse Systems)”:http://tersesystems.com/ was kind enough to point me in the right direction and explain “how to get Ganymede working(magpiebrain – Comments: Ganymede – Log4J Logging inside eclipse)”:http://www.magpiebrain.com/cgi-bin/mt-comments.cgi?entry_id=87. After remembering to add a Socket Appender for my program it worked a treat. I don’t like it as much as Chainsaw or “LogFactor5”:http://jakarta.apache.org/log4j/docs/lf5/features.html (both of which are standalone Swing applications) in terms of functionality, however Ganymede is much more convenient that either of them as it sits right in my IDE.
If it added some more flexible filters (I cannot for example say only show INFO messages and above for a given category), allowed me to change the background of the eclipse view, added a tree-based view and a search function then I’d be a happy bunny. Oh, and some documentation of course – although I suppose it wouldn’t take me long to write that myself…
2 Responses to “Ganymede Revisited – Log4J In Eclipse”
For anyone who’s wondering, the easiest way to use log4j with eclipse after the steps mentioned in the article is to:
BasicConfigurator.configure(new SocketAppender(“localhost”,4445));
Logger logger = Logger.getLogger(MyClass.class);
logger.info(“message”);
However, I do not know how to make the line numbers / method names show up in the Ganymede view. It is easy to get them to show on the Console or in a file however using something like:
PatternLayout(“%5p [%t] (%F:%L) – %m%n”)
If anyone knows what layout pattern Ganymede requires to populate the line # field, please let me know!
thanks,
–reid
And the equivilent XML (works equally well for chainsaw or LogFactor5):