我在GlassFish 3.1.1上部署了应用程序。我使用Eclipselink作为JPA提供者。是否有可能使glassfish / eclipselink将sql查询中绑定变量的值记录到文件中?
目前我有结果
[#|2011-11-21T18:49:39.807+0600|FINE|glassfish3.1.1|org.eclipse.persistence.session.file:/opt/glassfish3/glassfish/domains/domain1/applications/dof-web-1.0/WEB-INF/classes/_mainPU.sql|_ThreadID=20;_ThreadName=Thread-2;ClassName=null;MethodName=null;|SELECT ID, ABIS_BANK_ID, ADDRESS, IS_AGR_EXIST, AUX_VALUE, BIK, CDATE, COUNTRY, CUSER, ENG_VALUE, IIN, KAZ_VALUE, KPP, RUS_VALUE, SWIFT, UDATE, UUSER FROM SCHEMANAME.BANK WHERE (IS_AGR_EXIST = ?) ORDER BY RUS_VALUE ASC
bind => [1 parameter bound]|#]
但我必须得到变量值。
logging.properties内容:
javax.enterprise.system.tools.admin.level=INFO
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.formatter=com.sun.enterprise.server.logging.UniformLogFormatter
com.sun.enterprise.server.logging.GFFileHandler.logFormatDateFormat=yyyy-MM-dd'T'HH\:mm\:ss.SSSZ
javax.enterprise.system.ssl.security.level=INFO
org.apache.jasper.level=INFO
com.sun.enterprise.server.logging.GFFileHandler.flushFrequency=1
org.eclipse.persistence.session.level=FINER
javax.enterprise.system.tools.backup.level=INFO
javax.enterprise.resource.corba.level=INFO
javax.enterprise.resource.webcontainer.jsf.resource.level=INFO
javax.enterprise.system.core.classloading.level=INFO
javax.enterprise.resource.jta.level=INFO
java.util.logging.ConsoleHandler.level=FINEST
com.sun.enterprise.server.logging.GFFileHandler.file=${com.sun.aas.instanceRoot}/logs/server.log
javax.enterprise.system.webservices.saaj.level=INFO
java.util.logging.FileHandler.formatter=java.util.logging.XMLFormatter
javax.enterprise.system.tools.deployment.level=INFO
javax.enterprise.system.container.ejb.level=INFO
javax.enterprise.system.core.transaction.level=INFO
org.apache.catalina.level=INFO
javax.enterprise.resource.webcontainer.jsf.lifecycle.level=INFO
com.sun.enterprise.server.logging.GFFileHandler.rotationTimelimitInMinutes=0
javax.enterprise.resource.webcontainer.jsf.config.level=INFO
javax.enterprise.system.container.ejb.mdb.level=INFO
javax.enterprise.resource.webcontainer.jsf.timing.level=INFO
javax.enterprise.system.core.level=INFO
com.sun.enterprise.server.logging.GFFileHandler.rotationOnDateChange=false
org.apache.coyote.level=INFO
ShoalLogger.level=CONFIG
javax.level=INFO
javax.enterprise.resource.webcontainer.jsf.taglib.level=INFO
java.util.logging.FileHandler.limit=50000
com.sun.enterprise.server.logging.GFFileHandler.logtoConsole=false
javax.enterprise.resource.javamail.level=INFO
javax.enterprise.system.webservices.rpc.level=INFO
javax.enterprise.system.container.web.level=INFO
javax.enterprise.system.util.level=INFO
javax.enterprise.resource.resourceadapter.level=INFO
javax.enterprise.resource.webcontainer.jsf.facelets.level=INFO
com.sun.enterprise.server.logging.GFFileHandler.level=FINEST
javax.org.glassfish.persistence.level=INFO
javax.enterprise.resource.webcontainer.jsf.context.level=INFO
javax.enterprise.resource.webcontainer.jsf.application.level=INFO
javax.enterprise.resource.jms.level=INFO
com.sun.enterprise.server.logging.GFFileHandler.rotationLimitInBytes=2000000
javax.enterprise.system.core.config.level=INFO
org.jvnet.hk2.osgiadapter.level=INFO
javax.enterprise.system.level=INFO
javax.enterprise.system.core.security.level=INFO
java.util.logging.FileHandler.pattern=%h/java%u.log
javax.enterprise.system.container.cmp.level=INFO
com.sun.enterprise.server.logging.SyslogHandler.useSystemLogging=false
javax.enterprise.resource.sqltrace.level=FINE
javax.enterprise.resource.webcontainer.jsf.renderkit.level=INFO
javax.enterprise.system.webservices.registry.level=INFO
javax.enterprise.system.core.selfmanagement.level=INFO
com.sun.enterprise.server.logging.GFFileHandler.formatter=com.sun.enterprise.server.logging.UniformLogFormatter
.level=INFO
com.sun.enterprise.server.logging.GFFileHandler.maxHistoryFiles=0
log4j.logger.org.hibernate.validator.util.Version=warn
java.util.logging.FileHandler.count=1
javax.enterprise.resource.webcontainer.jsf.managedbean.level=INFO
org.glassfish.admingui.level=INFO
javax.enterprise.resource.jdo.level=INFO
javax.enterprise.system.core.naming.level=INFO
com.sun.enterprise.server.logging.GFFileHandler.retainErrorsStasticsForHours=0
Eclipselink版
[#|2011-11-21T18:49:31.333+0600|INFO|glassfish3.1.1|org.eclipse.persistence.session.file:/opt/glassfish3/glassfish/domains/domain1/applications/dof-web-1.0/WEB-INF/classes/_mainPU|_ThreadID=18;_ThreadName=Thread-2;|EclipseLink, version: Eclipse Persistence Services - 2.3.0.v20110604-r9504|#]
答案 0 :(得分:1)
您可以通过
进行设置"eclipselink.logging.parameters"="true"
在persistence.xml
。
实际上,默认情况下,对于日志级别< CONFIG,但似乎Glassfish对Java日志记录的使用令人困惑。请在EclipseLink上记录一个错误,即在检查默认参数日志记录时应使用正确的记录器级别。
答案 1 :(得分:1)
标题显示“Toplink”,但您的日志显示“Eclipselink”。请更正。
您是否尝试将该属性添加到persistence.xml
,Eclipse wiki advises:
<property name="eclipselink.logging.parameters" value="true"/>
也许它会在logging.properties
?