[Owl-devel] Logging in OWL

Jose M. Duarte jose.m.duarte at gmail.com
Wed Aug 4 08:45:26 EDT 2010

Yes for the program I'm developing (for bio vs crystal contacts
identification) I needed some proper logging. That's why I decided to give a
go to one of the logging frameworks.

First I tried the logging from the standard java library but I was not very
happy with it. Then I went for log4j which as usual with apache things is a
lot better.

Now I did see this apache commons logging thing, it seems like a meta
logging framework to use different frameworks underneath. But to be honest
it fell a bit like an overkill. I know in the long-run is probably not, but
at that point I couldn't be bothered. Anyway the implementation change
shouldn't be very difficult if we want to do it. The real difficult thing
with logging is the logging itself! what messages to write, which level to
put them in etc. After some experience using it I've realised it really is
not easy!

Anyway I definitely recommend it, the basic usage really is very simple, all
you need is to declare this constant in your class:

private static final Logger LOGGER = Logger.getLogger(UniprotEntry.class);

and then you use it like:

LOGGER.error("An error happened");
LOGGER.fatal("A real bad error");


On 4 August 2010 14:38, Henning Stehr <stehr at molgen.mpg.de> wrote:

> Hi Jose,
> I just looked through the history of OWL. The package is really
> getting more and more powerful. Great work. I saw that you also
> started to use logging which I think is really a good idea. I'm not
> sure which implementation you used but may I suggest to use the apache
> commons-logging? It looks almost like log4j but it is in fact just an
> adapter that can be used with different logging implementations in the
> calling application. This way we don't restrict ourselves to any of
> log4j/java logging/etc...
> Cheers,
> Henning
> _______________________________________________
> Owl-devel mailing list
> Owl-devel at bioinformatics.org
> http://www.bioinformatics.org/mailman/listinfo/owl-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bioinformatics.org/pipermail/owl-devel/attachments/20100804/08f7b29c/attachment.html>

More information about the Owl-devel mailing list