English 中文(简体)
如何使log4j 定期重开日志文件( logrotate)?
原标题:How can I make log4j reopen log files periodically (logrotate)

我的 sysadmin 一直“ 鼓励”我修补我们的网络应用程序日志, 以便很好地对日志进行对调 。 问题在于, 在对文件进行对调后, 程序停止了对日志的记录 。 是否有办法配置日志 4j 来在此发生后重开日志文件?

本评论解释了一般问题,但没有为log4j提供解决办法:https://stackoverflow.com/a/6514233/201748

最佳回答

我还需要测试它, 但对数旋转的 < code> copytruncate 选项应该做 。

问题回答

暂无回答




相关问题
Specify time zone of log4j s date

Is it possible to specify the time zone that log4j will use? I need the dates in the log file to be a different time zone than the application s. log4j s PatternLayout uses SimpleDateFormat. ...

java wrapper around log4j logger and java.util.logging

I am writing a library. The library can be used by applications that use log4j loggers and java.util.logging loggers. So, I wrote a quick wrapper class, that encapsulates both loggers. I allow the ...

Grails log4j configuration

I ve repeatedly had problems with the DSL introduced by Grails in version 1.1 for configuring Log4J. My current configuration looks like this: log4j = { debug com.mypackages ...

Creating daily logs with Log4j?

What configuration values are needed to setup Log4j to use the following pattern? MyApp-Mon.log MyApp-Tue.log MyApp-Wed.log Etc With each file containing the days log. This sounds easy enough to do ...

Overriding log4j settings at deploy time

For an application which is deployed on a large number of machines I took the decision to deploy a standard log4j.xml file with the application package, just to make sure that have the same settings ...

How to validate Java logging properties files?

I have a basic facility for allowing users to remotely apply changes to the logging files in my application. Some logs are configured using java.util.logging properties files, and some are configured ...

How do you Change a Package s Log Level using Log4j?

I ve encountered the following bug: http://issues.apache.org/jira/browse/AXIS2-4363 It states the following: This error only occurs when log level for org.apache.axiom is DEBUG so a ...

热门标签