Instead you can use RollingFileAppender which rolls log files when it reaches a certain size and with this appender you can also define the maximum number of backups.
the best way is to write your own little utility and register it as a "scheduled task" to run at a pre-defined time in the day. you can register a service too, but i feel that'll be an overkill.
I suggest that you decrease your logging level as much as you can. There is a log4j.properties file in each of alfresco's apps (alfresco/WEB-INF/classes/log4j.properties and share/WEB-INF/classes/log4j.properties) - logging is noted to affect the performance of alfresco.
Also, you should be able to disable logging completely.
发布评论
评论(4)
Alfresco 使用
DailyRollingFileAppender
并配置为每天滚动日志文件。相反,您可以使用 RollingFileAppender,它会在日志文件达到一定大小时滚动日志文件,并且使用此附加程序您还可以定义最大备份数。
根据上面的配置,appender 仅存储最近 10 个备份。顺便说一句,它也比 DailyRollingFileAppender 更安全。
根据log4j javadoc;
Alfresco is using
DailyRollingFileAppender
and it is configured to roll log file daily.Instead you can use
RollingFileAppender
which rolls log files when it reaches a certain size and with this appender you can also define the maximum number of backups.According to the configuration above the appender stores only the last 10 backups. BTW it is also more secure than
DailyRollingFileAppender
.According to log4j javadoc;
最好的方法是编写自己的小实用程序并将其注册为“计划任务”以在一天中的预定义时间运行。
您也可以注册一项服务,但我觉得这有点过分了。
the best way is to write your own little utility and register it as a "scheduled task" to run at a pre-defined time in the day.
you can register a service too, but i feel that'll be an overkill.
我建议您尽可能降低日志记录级别。每个 alfresco 的应用程序中都有一个 log4j.properties 文件(alfresco/WEB-INF/classes/log4j.properties 和 share/WEB-INF/classes/log4j.properties) - 日志记录会影响 alfresco 的性能。
另外,您应该能够完全禁用日志记录。
I suggest that you decrease your logging level as much as you can. There is a log4j.properties file in each of alfresco's apps (alfresco/WEB-INF/classes/log4j.properties and share/WEB-INF/classes/log4j.properties) - logging is noted to affect the performance of alfresco.
Also, you should be able to disable logging completely.
请参阅http://www.autohotkey.com/forum/topic43254.html
它提供了一种简单的工具来删除日志。只需使用它即可。
Please see http://www.autohotkey.com/forum/topic43254.html
Its providing one simple tool to delete logs. Just use it.