在日志中显示JAVA_OPTS环境变量如何配置它? [英] Showing JAVA_OPTS environment variable in log How do i configure it?

查看:344
本文介绍了在日志中显示JAVA_OPTS环境变量如何配置它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的tomcat中配置了我的ENV变量,例如export JAVA_OPTS="$JAVA_OPTS -Dpassword=password".它显示在日志中.如何配置它以使其不显示在tomcat日志中.

I have configured my ENV variable in my tomcat like export JAVA_OPTS="$JAVA_OPTS -Dpassword=password". It's showing in the log. How do I configure it to not show in the tomcat log.

推荐答案

您可以通过在conf/server.xml中注释此行来禁用VersionLoggerListener:

You can disable the VersionLoggerListener by commenting this line in conf/server.xml :

<Listener className="org.apache.catalina.startup.VersionLoggerListener" />

它不仅会隐藏密码,还会隐藏其他变量.请注意,启动变量应该位于CATALINA_OPTS中,而不是JAVA_OPTS中.

It will hide not only the password but also the other variables. Please note that startup variables should be in CATALINA_OPTS, not JAVA_OPTS.

setenv.sh的示例:

Example for setenv.sh :

SAC_DISPLAY_COPYRIGHT=0
CATALINA_OPTS="-Xms2g -Xmx2g -Djasypt.encryptor.password=mypassword"

这篇关于在日志中显示JAVA_OPTS环境变量如何配置它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆