Max Makarov
Max Makarov

Reputation: 63

log4j v1.x how to add property to log4j.xml like for log4j.properties

I have a little problem with configuring log4j to show hibernate queries with binded values.

I need to add log4j.logger.org.hibernate.type=trace to log4j.properties, but a have log4j.xml.

The question is how can I configure this property for log4j.xml? Found many examples how to configure appenders and so on within xml but no one 'how to configure additional properties with xml'.

Upvotes: 0

Views: 249

Answers (2)

Ioannis Mitrolios
Ioannis Mitrolios

Reputation: 490

Try this:

<logger name="org.hibernate.type">
    <level value="TRACE"/>
</logger>

Just in case you have similar problems in future this might be useful. From my experience it is quite accurate.

Upvotes: 1

Dylan Meeus
Dylan Meeus

Reputation: 5822

Something like this in your configuration (.xml) file should solve it: <Logger name="org.hibernate.type" level="trace" />

Upvotes: 0

Related Questions