openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nasseria1 <>
Subject Re: Use logback for OpenJPA as its logger
Date Sat, 17 Jul 2010 06:00:11 GMT

you are completely right, we are using logback 0.9.22 that is based on SLF4J

Thanks mike for your reply,
I guess you mean we should use
custom logging  method. In this way we should extend a factory that is of
type org.apache.openjpa.lib.log.LogFactory.

This is a simple interface as below:

public interface LogFactory {
  public org.apache.openjpa.lib.log.Log getLog(String arg0);

its clear that we just needt to implement getLog method that simply returns
an instance of org.apache.openjpa.lib.log.Log
But the log that SLF4J factory returns (and we actually we require it) is
not compatible with it, it's of type org.slf4j.Logger when we use
So, we are facing with the type compatibilty problem.

BTW, one possible solution is using adapter pattern that we design an
adapter class which implement org.apache.openjpa.lib.log.LogFactory and in
method we should return the expected type (org.slf4j.Logger in our case)

However, I am not sure using adapter will solve this problem correctly, coz
its a bit cluttering and we assume it the last way.
so I m looking for a better solution.

However, thanks for sharing ideas
Waiting for any other ideas,

View this message in context:
Sent from the OpenJPA Developers mailing list archive at

View raw message