opensubscriber
   Find in this group all groups
 
Unknown more information…

u : users@openejb.apache.org 23 May 2012 • 11:01PM -0400

Re: Logging Levels of OpenJPA in Apache TomEE
by Bertrand Guay-Paquet

REPLY TO AUTHOR
 
REPLY TO GROUP




Good stuff! It works with system.properties like so:

openjpa.Log = DefaultLevel=TRACE, SQL=TRACE, Query=TRACE

Thanks for all your help,
Bertrand

On 23/05/2012 3:56 AM, Romain Manni-Bucau wrote:
> Hi,
>
> https://issues.apache.org/jira/browse/OPENEJB-1834
>
> should be fixed on trunk (just tested locally)
>
> however setting openjpa.Log in conf/system.properties should be fine
>
> - Romain
>
>
> 2012/5/23 Ravindranath Akila<ravindranathakila@gmai...>
>
>> Maybe you should get rid of "Query" and try? I haven't seen it before. Hth.
>> On May 23, 2012 6:07 AM, "Bertrand Guay-Paquet"<bernie@step...>
>> wrote:
>>
>>> Hi,
>>>
>>> I'm still not able to get OpenJPA logs.
>>>
>>> I tried the following combinations:
>>> <property name="openjpa.Log" value="stdout, DefaultLevel=TRACE,
>> SQL=TRACE,
>>> Query=TRACE" />
>>> <property name="openjpa.Log" value="File=c:\openjpa.log,
>>> DefaultLevel=TRACE, SQL=TRACE, Query=TRACE" />
>>> <property name="openjpa.Log" value="File=../logs/openjpa.**log,
>>> DefaultLevel=TRACE, SQL=TRACE, Query=TRACE" />
>>>
>>> I also followed the recipe from
>>> http://mail-archives.apache.
>> **org/mod_mbox/openjpa-users/**200901.mbox/%**
>>> 3Cc4a1048f0901071037x6ad504b6k**9df488fe7b0b8832@mail.gmail.**com%3E<
>> http://mail-archives.apache.org/mod_mbox/openjpa-users/200901.mbox/%3Cc4a1048f0901071037x6ad504b6k9df488fe7b0b8832@mail...%3E
>>> and tried
>>> <property name="openjpa.Log" value="commons" />
>>> and
>>> <property name="openjpa.Log" value="commons, DefaultLevel=TRACE,
>>> SQL=TRACE, Query=TRACE" />
>>>
>>> with a logging.properties file in WEB-INF/classes:
>>> ===BEGIN===
>>> handlers = org.apache.juli.FileHandler,
>> java.util.logging.**ConsoleHandler
>>> org.apache.juli.FileHandler.**level = ALL
>>> org.apache.juli.FileHandler.**directory = ${catalina.base}/logs
>>> org.apache.juli.FileHandler.**prefix = openjpa.
>>>
>>> java.util.logging.**ConsoleHandler.level = ALL
>>> java.util.logging.**ConsoleHandler.formatter = java.util.logging.**
>>> SimpleFormatter
>>>
>>> # enable SQL logging
>>> openjpa.jdbc.SQL.level=ALL
>>> ===END===
>>>
>>> With this last try, logs/openjpa.date.log is created but it doesn't
>>> contain any SQL statements.
>>>
>>> I'm starting to think that since OpenJPA is initialized by TomEE all
>>> logging settings are already set when my persistence.xml is loaded. Did
>> you
>>> manage to successfully use the properties you suggested in a real web
>> app?
>>> Regards,
>>> Bertrand
>>>
>>>
>>> On 16/05/2012 1:31 PM, Ravindranath Akila wrote:
>>>
>>>> Sorry, correction: should be trace, not debug
>>>>
>>>> <property name="openjpa.Log" value="File=../logs/openjpa.**log,
>>>> DefaultLevel=TRACE, Runtime=TRACE, SQL=TRACE"/>
>>>>
>>>> On May 16, 2012 10:58 PM, "Ravindranath Akila"<ravindranathakila@**
>>>> gmail.com<ravindranathakila@gmai...>>
>>>> wrote:
>>>>
>>>>> Hth:
>>>>>
>>>>> <property name="openjpa.Log" value="File=../logs/openjpa.**log,
>>>>>
>>>> DefaultLevel=DEBUG, Runtime=DEBUG, SQL=DEBUG"/>
>>>>
>>>>> On May 16, 2012 9:28 PM, "Bertrand Guay-Paquet"<bernie@step.**
>> polymtl.ca<bernie@step...>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>> Another question regarding logging + TomEE :)
>>>>>>
>>>>>> I followed the instructions in the OpenJPA documentation to increase
>> the
>>>>> logging level of JPA to show SQL statements but it didn't work. Do I
>> need
>>>> to do anything special for it to work inside TomEE? Ideally, I'd love to
>>>> set the logging level for a single WAR.
>>>>
>>>>> Here's what I tried.
>>>>>> In persistence.xml:
>>>>>> <property name="openjpa.Log" value="slf4j" />
>>>>>>
>>>>>> In WEB-INF/classes/log4j.**properties of my WAR:
>>>>>> log4j.category.openjpa=TRACE
>>>>>> log4j.category.openjpa.jdbc.**SQL=TRACE
>>>>>> log4j.category.openjpa.Query=**TRACE
>>>>>>
>>>>>> In conf/logging.properties:
>>>>>> log4j.category.openjpa=TRACE
>>>>>> log4j.category.openjpa.jdbc.**SQL=TRACE
>>>>>> log4j.category.openjpa.Query=**TRACE
>>>>>>
>>>>>> In the catalina log I see:
>>>>>> WARNING: Log4j not installed. The following properties will be
>> ignored.
>>>>>> 16-May-2012 3:41:16 PM org.apache.openejb.OpenEJB$**Instance<init>
>>>>>> WARNING: Ignored conf/logging.properties property
>>>>>>
>>>>> 'log4j.category.openjpa'
>>>>> 16-May-2012 3:41:16 PM org.apache.openejb.OpenEJB$**Instance<init>
>>>>>> WARNING: Ignored conf/logging.properties property
>>>>>>
>>>>> 'log4j.category.openjpa.jdbc.**SQL'
>>>>> 16-May-2012 3:41:16 PM org.apache.openejb.OpenEJB$**Instance<init>
>>>>>> WARNING: Ignored conf/logging.properties property
>>>>>>
>>>>> 'log4j.category.openjpa.Query'
>>>>> Obviously, I'm not using the right approach but I don't know where to
>>>>> find instructions so I'm asking here.
>>>>> Regards,
>>>>>> Bertrand
>>>>>>

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.