Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Howto log SQL with java.util.logging?
Howto log SQL with java.util.logging? [message #716484] Wed, 17 August 2011 14:27
David I is currently offline David IFriend
Messages: 6
Registered: July 2009
Junior Member
I have read the following webpages but I cannot get the SQL from Eclipselink v2.1.1 to print out.

I have a persistence.xml with this in it:

      <property name="" value="MySQL"/>      
      <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
      <property name="javax.persistence.jdbc.user" value="trackerS"/>
      <property name="eclipselink.cache.shared.default" value="false"/>
      <property name="eclipselink.allow-zero-id" value="true"/>
      <property name="eclipselink.logging.logger" value="JavaLogger"/>
      <property name="eclipselink.logging.level.sql" value="FINEST" />
      <property name="eclipselink.logging.level" value="FINEST" />

I use java.util.logging and I have been using this file in my testing:

handlers = java.util.logging.FileHandler
.level = ALL
tracker.level = ALL
# File Logging
java.util.logging.FileHandler.pattern = log/tracker-%u.log
java.util.logging.FileHandler.formatter = tracker.LogFormatter
java.util.logging.FileHandler.level = INFO
java.util.logging.FileHandler.append = true
java.util.logging.FileHandler.limit = 1000000
java.util.logging.FileHandler.count = 10

handlers = java.util.logging.ConsoleHandler
 java.util.logging.ConsoleHandler.level = CONFIG
 #org.eclipse.persistence.SessionLog.level = FINE
 #eclipselink.logging.level = FINE
 java.util.logging.ConsoleHandler.formatter = org.eclipse.persistence.logging.LogFormatter
 #org.eclipse.persistence.LoggingSession.connection.level = FINE

I realize the ConsoleHandler is overriding the FileHandler right now. I've tried all the options that are commented out but nothing works.

Any ideas?
Previous Topic:hibernate gotchas
Next Topic:[RESOLVED] ClassCastException
Goto Forum:

Current Time: Sat Nov 28 20:15:34 GMT 2015

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

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