[ 
https://issues.apache.org/jira/browse/OPENJPA-2345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13786985#comment-13786985
 ] 

Luca Burgazzoli commented on OPENJPA-2345:
------------------------------------------

Looks like a general issue with the logging system as slf4j and log4j have a 
completed different behaviour even in non OSGi environments (obviously with the 
same logging configuration which in this case is log4j).

I've created a simple project on GitHub 
https://github.com/lburgazzoli/lb-sandbox-java:
- ./gradlew openJpaSlf4j logs a few things only
- ./gradlew openJpaLog4j logs a more detailed execution

 



> OpenJPA logging in OSGi/Karaf
> -----------------------------
>
>                 Key: OPENJPA-2345
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2345
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: logging, osgi
>    Affects Versions: 2.2.1
>            Reporter: Luca Burgazzoli
>
> lbuonline 
> I'm trying to configure OpenJPA to properly work in Apache Karaf 2.3.0 and 
> everything seems to work well except the logging part as if I set the 
> following properties in the persistence.xml, the statement are obviously 
> logged in the console: 
> <properties>
>     <property name="openjpa.Log"                         
> value="DefaultLevel=TRACE"/>
>     <property name="openjpa.ConnectionFactoryProperties" 
> value="PrintParameters=true"/>
> </properties>
> If I set the following properties in the persistence.xml, nothing is logged 
> in karaf's log file: 
> <properties>
>     <property name="openjpa.Log"                         value="slf4j"/>
>     <property name="openjpa.ConnectionFactoryProperties" 
> value="PrintParameters=true"/>
> </properties>
> I've also tried to configure a custom logger or to use log4j or common as 
> logger but then the bundle fails to start with the following error: 
> 2013-03-01 10:00:37,360 | DEBUG | rint Extender: 1 | BlueprintEventDispatcher 
>         | ntainer.BlueprintEventDispatcher  136 | 7 - 
> org.apache.aries.blueprint.core - 1.0.1 | Sending blueprint container event 
> BlueprintEvent[type=GRACE_PERIOD, 
> dependencies=[(&(&(!(org.apache.aries.jpa.proxy.factory=*))(osgi.unit.name=DATAPU))(objectClass=javax.persistence.EntityManagerFactory))]]
>  for bundle jpa-openjpa 



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to