简体   繁体   English

如何在不更改代码的情况下更改tomcat中eclipselink的日志级别?

[英]How to change the log level for eclipselink in tomcat without code changes?

Sorry, if this is a dup. 抱歉,如果这是一个dup。 Seems like it should be, but I didn't find it. 似乎应该如此,但我没有找到它。

My logging works fine when I add the following to persistence.xml: 将以下内容添加到persistence.xml时,我的日志记录工作正常:

   <property name="eclipselink.logging.level" value="FINE"/>
   <property name="eclipselink.logging.level.sql" value="FINE"/>
   <property name="eclipselink.logging.logger" value="ServerLogger"/>  

However, I would like to only turn this logging on occasionally. 但是,我只想偶尔打开此日志记录。 Perhaps, turn it on only if there is a issue. 也许只有在出现问题时才打开它。

If there way to change this setting at runtime, with no code changes. 如果可以在运行时更改此设置,则无需更改代码。 Note: I am using Tomcat and I use log4j for my current program logging. 注意:我正在使用Tomcat,并且将log4j用于当前程序记录。

GC_ GC_

If you are using ServerLogger, EclipseLink will default to your server's logging mechanism, but only if the ServerPlatform class within EclipseLink supports one. 如果使用ServerLogger,则EclipseLink将默认为服务器的日志记录机制,但前提是EclipseLink中的ServerPlatform类支持该机制。 Tomcat isn't a EE server and so you don't likely have a ServerPlatform class for it, so this is a meaningless property and will default to DefaultLogger which writes to the system.out. Tomcat不是EE服务器,因此您可能没有ServerPlatform类,因此它是无意义的属性,默认为DefaultLogger,它将写入system.out。

You can specify java logging , but to specifically integrate with log4J, see the article here 您可以指定java logging ,但是要专门与log4J集成,请参阅此处的文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在运行时更改 log4j2.xml 中的记录器级别而不重新启动 tomcat 服务 - How to change logger level in log4j2.xml at runtime without restarting tomcat service 如何更改 KafkaStream 的日志级别 - How to change log level of KafkaStream 如何在服务器级别而不是在应用程序级别更改 tomcat 的默认错误页面? - How to change default error page for tomcat on server level and not on the application level? 如何在不重新启动 Spring Boot 应用程序的情况下在运行时更改日志级别 - how do I change log level in runtime without restarting spring boot application 如何在运行时更改日志级别而不重新启动Vert.x应用程序 - How do I change log level in runtime without restarting Vert.x application 如何更改Kaa客户端的日志级别 - How to change log level of Kaa client 如何在Hadoop 2中更改用户日志的日志级别? - How to change log level of userlogs in Hadoop 2? 如何配置EclipseLink 2.0和Spring 3.0.5以及Tomcat 6? - How to configure EclipseLink 2.0 and Spring 3.0.5 and Tomcat 6? 如何在不更改代码而仅更改数据库的情况下在应用程序中执行功能更改? - How to carry out a functionality change in the application without code changes and only database changes? 如何以编程方式更改log4j2中的日志级别 - How to change programatically log level in log4j2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM