Skip to main content

Problem with logging hibernate 4.1.1(using log4j) and GlassFish 3.1.2.2

1 reply [Last post]
rafaelobitten
Offline
Joined: 2013-01-17
Points: 0

Dear,

When i updated the glassfish from 3.1.2 to 3.1.2.2 the hibernate logging to show sql values stopped to work: I use the sl4fj to log it

-commons-logging
-slf4j-log4j
-log4j(1.2.17)
-slf4j-api(1.7.2)

hibernate.cfg

true true

log4j.properties

# Log everything. Good for troubleshooting
log4j.logger.org.hibernate=INFO

log4j.logger.org.hibernate.type=ALL
log4j.logger.org.hibernate.jdbc=trace

So i got this in my stdout

Informações: HHH000046: Connection properties: {user=root, password=****}
Informações: HHH000006: Autocommit mode: false

I dont know why its happens, but if i downgrade to glassfish 3.2, with same configuration, it works and i can see the sql values from hibernate.

Output in Glassfish 3.1.2.2:

Informações: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}

log4j doesnt work.

Output in GlassFish 3.1.2:

INFO Version:37 - HCANN000001: Hibernate Commons Annotations {4.0.1.Final}

LOG4j works !!

Someone has any idea ?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rafaelobitten
Offline
Joined: 2013-01-17
Points: 0

I tested with other versions of hibernate and doesn't works, only works if i do downgrade of 3.1.2.2 to 3.1.2