<property name="eclipselink.logging.level" value="FINE" />
如何设置服务器的日志级别。我想在我的开发服务器上看到Level.FINE。但当然只有Level.WARNING在生产服务器上。Glassfish v3服务器上的JPA日志记录级别
如果我把上面的行放到persistence.xml中,那么它会在两台机器上自动设置。我必须记得手动关闭它。这当然是危险的。
非常感谢。
<property name="eclipselink.logging.level" value="FINE" />
如何设置服务器的日志级别。我想在我的开发服务器上看到Level.FINE。但当然只有Level.WARNING在生产服务器上。Glassfish v3服务器上的JPA日志记录级别
如果我把上面的行放到persistence.xml中,那么它会在两台机器上自动设置。我必须记得手动关闭它。这当然是危险的。
非常感谢。
你可以参考EclipseLink/Examples/JPA/Logging
注意:设置eclipselink.logging.level到金不足(如的EclipseLink 2.4.0的 - 朱诺),你必须eclipselink.logging.level.sql设为精细。
<property name="eclipselink.logging.level" value="FINE"/>
<property name="eclipselink.logging.level.sql" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
我添加几行代码写进logging.properties文件和它的作品,而不将其添加到persistence.xml中。所以现在是服务器依赖。
eclipselink.logging.level=FINE
eclipselink.logging.level.sql=FINE
eclipselink.logging.parameters=true
我一直在为此而努力。我发现的是,在GlassFish上(在3.1.2的leas上),您可以编辑GlassFish域/ 域/config目录中的logging.properties文件。
找到org.eclipse.persistence.session.level条目,并更改如下:
org.eclipse.persistence.session.level=FINE
除了这个,我发现我需要添加这两个条目:
org.eclipse.persistence.level = FINE
org.eclipse.persistence.sql.level = FINE
以这种方式编辑logging.properties文件时,不需要在persistence.xml文件中添加任何关于日志记录的任何内容,并且它将满足上述要求。
注意:我还没有设法让eclipselink.logging.parameter =真在persistence.xml工作(这是不是在logging.properties分配)。所以SQL日志工作,只是不完全绑定转储。
请看看这里,这正常工作对我来说: [我的其他问题] [1] [1]:http://stackoverflow.com/questions/17047333/logging - 电平 - 上的glassfish -3- JPA-的EclipseLink –