james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Bagnara <apa...@bago.org>
Subject Re: Logging library in our projects
Date Sat, 31 Dec 2011 14:03:34 GMT
2011/12/31 Eric Charles <eric@apache.org>:
> Hello Norman,
>
> Yes, I can understand this.
>
> So, how are we gonna create a POP3Protocol(ProtocolHandlerChain,
> ProtocolConfiguration, Logger) from server which uses slf4j?
>
> We need to give as third parameter a org.apache.james.protocols.api.Logger.
>
> An adapter between org.slf4j.Logger and
> org.apache.james.protocols.api.Logger could do the job, even if find this a
> bit overhead.
>
> When integrating server and protocols trunk a few days before, I thus though
> to these 2 options:
> 1.- the adapter.
> 2.- the uniformisation between all projects.
>
> but didn't know where to go..., this is the reason for this thread :)
> Maybe you have a third option in mind such as having two completely
> separated logging mechanism when running protocols in server?

IMO we should go with #1 (using a private Logger interface and then
use an adapter to slf4j).

I also think that an slf4j adapter could be provided direclty in the
protocols project and used as an optional dependency (so you don't
have to write the adapter in every project).
The "right" approach would be to have a protocols module with the
slf4j adapter, but IMO a module for a single class is too much, so
maybe we can simply put the adapter in the netty module or in the api
module and then declare the slf4j dependency as optional, so that
users of the library will decide if they want to use the slf4j logger
or instead provide their own implementation.

I'm not sure if this plays well with OSGi.

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message