Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Logging sql with logback(Logging sql with logback)
Logging sql with logback [message #718154] Tue, 23 August 2011 08:37 Go to next message
Eclipse UserFriend
Weblogic 10.3.0.0
Eclipselink 2.1.0
logback 0.9.21
slf4j 1.6.0

I would like to log the jpa sql using the logback configuration.
And be able to change the eclipselink log level on the fly.

Anyone knows how to do that ???
Re: Logging sql with logback [message #720498 is a reply to message #718154] Tue, 30 August 2011 13:58 Go to previous messageGo to next message
Eclipse UserFriend
You can implement your own logger to integrate with a third party logging service.

See,
http://wiki.eclipse.org/EclipseLink/Examples/JPA/CustomLogger

http://wiki.eclipse.org/EclipseLink/Examples/Foundation/Logging
(no subject) [message #720499 is a reply to message #718154] Tue, 30 August 2011 13:58 Go to previous messageGo to next message
Eclipse UserFriend
You can implement your own logger to integrate with a third party logging service.

See,
http://wiki.eclipse.org/EclipseLink/Examples/JPA/CustomLogger

http://wiki.eclipse.org/EclipseLink/Examples/Foundation/Logging
--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Re: Logging sql with logback [message #890115 is a reply to message #718154] Thu, 21 June 2012 03:49 Go to previous message
Eclipse UserFriend
A nice developer (Miguel Angel Sosvilla Luis) has written a class to do this. I can't post links as I'm new but search for

gist: 1325764

And you'll find it on github.

And configure it something like this in your persistence.xml

<properties>
	<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
	<property name="javax.persistence.jdbc.url"  value="jdbc:mysql://localhost:3306/dbname" />
	<property name="javax.persistence.jdbc.user" value="root" />
	<property name="javax.persistence.jdbc.password" value="" />
	<property name="eclipselink.target-database" value="MySQL"/>
	<property name="eclipselink.logging.level" value="FINE"/>
	<property name="eclipselink.logging.parameters" value="true"/>
	<property name="eclipselink.logging.timestamp" value="false"/>
	<property name="eclipselink.logging.logger" value="yourpackage.Slf4jSessionLogger"/>
</properties>
Previous Topic:fixed timestamp for start/end values for historical data
Next Topic:exclude-unlisted-classes=false in Equinox OSGI
Goto Forum:
  


Current Time: Tue Jul 01 09:15:43 EDT 2025

Powered by FUDForum. Page generated in 0.03252 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top