persistence@glassfish.java.net

Re: Useful feature

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Tue, 29 Aug 2006 12:34:34 -0700

Hi Adam,

You can also use asadmin CLI or admin GUI to change log level for all JPA apps
(see
https://glassfish.dev.java.net/javaee5/persistence/entity-persistence-support.html):

# Using asadmin CLI to set logging level globally for all persistence units in
this domain.xml by adding a property to log-service.module-log-levels.

For example the following command will set log levels for all the TopLink
Essentials loggers to FINEST

asadmin set
"server.log-service.module-log-levels.property.oracle\.toplink\.essentials"=FINEST

# Using Admin GUI: Go to Logging tab, Log levels sub tab and add property using
"Additional Module Log Level Properties"

thanks,
-marina

Adam Bien wrote:
> Hi Tom, hi marina,
>
> increasing the logging level to fine works very well for me. P6SPY is no
> more needed -> what is great.
>
> I wrote an entry about it:
>
> http://www.adam-bien.com/roller/page/abien?entry=glassfish_and_jpa_sql_monitoring
>
>
> thanks,
>
> adam
>
> Tom Ware schrieb:
>
>> Hi Adam,
>>
>> Alot of this information can be made visible when using the
>> persistence API just by increasing the logging level.
>>
>> When using the Java Persistence API, you can just provide the
>> "toplink.logging.level" property in your persistence unit and set the
>> value to FINE and you should be able to see all the SQL including the
>> binding variables. I am not sure if that will completely satisfy your
>> requirement, but perhaps it will help.
>>
>> -Tom
>>
>> Adam Bien wrote:
>>
>>> In the past a used p6spy to log all SQL statements to a file for
>>> debugging purposes. P6spy even writes the value of binding variables
>>> (the ? in prepared statements)
>>> Is it possible to do the same with glassfish? -> this would be a
>>> great feature and help to monitor caching behavior and monitoring,
>>>
>>> cheers,
>>>
>>> adam bien
>>>
>>>
>>
>