magpiebrain

Sam Newman's site, a Consultant at ThoughtWorks

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…

Advertisements

2 Responses to “Ganymede Revisited – Log4J In Eclipse”

  1. reid holmes

    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

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Basic HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS

%d bloggers like this: