这个问题让我发疯,因为我不知道为什么会发生这种情况,而且我已经在上面浪费了一周的时间,却毫无进展。
我正在维护在 JBoss 4.3 上运行的遗留应用程序,利用:
- Struts2
- Hibernate 3.2.5
- Log4J 1.2.15
- ojdbc5(针对 Oracle 10g 的 Oracle JDBC 驱动程序)
- Apache Commons Logging 1.1(脆弱的第三方自定义组件所需的严重依赖项)
- c3p0
0.9.1.2日志文件总是被(我猜是 Apache?)垃圾污染,例如:
07:37:04,024 DEBUG [Dgester] 新 match='web-app/mime-mapping/extension'
07:37:04,024 DEBUG [Digester] Fire begin() for CallParamRule[paramIndex=0, attributeName=null, from stack=false]
07:37:04,024 调试 [sax] 字符(tcl)
07:37:04,028 调试 [sax] endElement(,,扩展名)
07:37:04,028 调试 [消化器] match='web-app/mime-mapping/extension'
07:37:04,028 调试 [消化器] bodyText='tcl'
07:37:04,028 DEBUG [Digester] Fire body() for CallParamRule[paramIndex=0,attributeName=null,来自 stack=false]
07:37:04,028 DEBUG [Digester] 弹出正文
我从来没有真正关心过,直到最近,下面的行后面跟着数十万
07:37:04,024 DEBUG [Dgester] 推送正文 '
...
'
现在我非常关心,因为出于审计原因,我们必须无限期地维护这些日志文件,并且它们在服务器重新启动后以大约 20MB 的大小开始。
我最初认为通过从 log4j.properties 禁用 Sax Digester 日志记录可以解决问题,但我尝试的任何方法都不起作用。
http://programming.itags.org/development-tools/59562/
< a href="https://community.jboss.org/thread/4401" rel="nofollow noreferrer">https://community.jboss.org/thread/4401
http://www.coderanch.com/t/47763/Struts/disable-struts-debug-info-messages
http://mail-archives.apache.org/mod_mbox/logging-log4j-user/200210.mbox/%[电子邮件受保护]%3E
http://deepaksrivastav.com/?p=63
http://www.mail-archive.com/[电子邮件受保护]/msg10703.html
有人这里提到它们可能是流氓 log4j.properties 或 simplelog .properties 漂浮在类路径上,这让我感到悲伤,但经过彻底的政治迫害后,我发现没有什么可以真正抑制日志文件污染。
任何帮助或建议将不胜感激。
编辑:下面的一个很好的建议提醒我,我已经尝试将此服务器实例的 JBoss log4j xml 配置文件中的所有内容设置为 WARN 日志记录。从字面上看,什么都没有改变。我注意到临时文件和工作目录也没有得到正确清理,所以我擦除了它们,但仍然没有任何结果。希望这些信息能有所帮助,而不是吓跑人们,他们会想:“伙计,那家伙完蛋了!” :)
This problem is driving me crazy because I am not sure why this just started happening, and I have already wasted a week on it with absolutely no progress.
I am maintaining a legacy application running on JBoss 4.3 utilizing:
- Struts2
- Hibernate 3.2.5
- Log4J 1.2.15
- ojdbc5 (Oracle JDBC driver against Oracle 10g)
- Apache Commons Logging 1.1 (Vile dependency required by brittle third party custom component)
- c3p0 0.9.1.2
The log files have always been polluted with (what I am guessing is Apache?) garbage like:
07:37:04,024 DEBUG [Digester] New match='web-app/mime-mapping/extension'
07:37:04,024 DEBUG [Digester] Fire begin() for CallParamRule[paramIndex=0, attributeName=null, from stack=false]
07:37:04,024 DEBUG [sax] characters(tcl)
07:37:04,028 DEBUG [sax] endElement(,,extension)
07:37:04,028 DEBUG [Digester] match='web-app/mime-mapping/extension'
07:37:04,028 DEBUG [Digester] bodyText='tcl'
07:37:04,028 DEBUG [Digester] Fire body() for CallParamRule[paramIndex=0, attributeName=null, from stack=false]
07:37:04,028 DEBUG [Digester] Popping body text
I never really cared until recently when the following line has been followed by hundreds of thousands of lines of whitespace.
07:37:04,024 DEBUG [Digester] Pushing body text '
...
'
Now I care greatly because for auditing reasons we must maintain these log files indefinitely and they start out after server restart at around 20MB.
I initially figured that by disabling Sax Digester logging from log4j.properties that I solved the problem but nothing I have attempted has been working.
http://programming.itags.org/development-tools/59562/
https://community.jboss.org/thread/4401
http://www.coderanch.com/t/47763/Struts/disable-struts-debug-info-messages
http://mail-archives.apache.org/mod_mbox/logging-log4j-user/200210.mbox/%[email protected]%3E
http://deepaksrivastav.com/?p=63
http://www.mail-archive.com/[email protected]/msg10703.html
Somebody here mentioned that their could be the possibility of a rogue log4j.properties or simplelog.properties floating around on the classpath that is causing me this grief but after an exhaustive witch hunt I find nothing is truly supressing the log file pollution.
Any help or advice would be greatly appreciated.
EDIT: A great suggestion below reminded me that I had already tried setting logging to WARN on everything within the JBoss log4j xml configuration file for this server instance. Literally nothing changed. I noticed that the temp files and working directories were not getting cleaned up properly too so I wiped them and still nothing. Hope this information helps and not scare away people thinking, "Man, that guy is screwed!" :)
发布评论
评论(1)
关闭 server/xxx/conf/jboss-log4j.xml 中的调试日志记录。将其设置为 info 这样你就不会看到所有这些不必要的日志行
Turn off debug logging in server/xxx/conf/jboss-log4j.xml. Set it to info so that you will not see all these unnecessary logging lines