centos – 每天如何刷新日志?

前端之家收集整理的这篇文章主要介绍了centos – 每天如何刷新日志?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在运行名为yajsw的工具,它生成一个名为wrapper.log.0的日志文件.一段时间后我注意到它变得太大而我也无法运行zip命令?我可以运行一个cron作业来将日志文件每日刷新到单独的日常日志文件中吗?知道怎么做吗?
看一下 documentation,你可以配置yajsw来滚动它的日志

达到了wrapper.logfile.maxsize

The wrapper.log file can be set to roll when the file reaches a specified size. The default value of 0 will disable log file rolling. To roll the file,specify a maximum file size in bytes. The size can be abbreviated with the suffixes ‘k’ for kilobytes,or ‘m’ for megabytes. For example,’10m’ sets the log file to be rolled when it reaches a size of 10 megabytes.

或其中一个条件

满足wrapper.logfile.rollmode

Controls the roll mode of the log file. Possible values include:

JVM – The log file will be rolled on Wrapper startup as with the WRAPPER mode. But it will also be rolled just before any restarted JVMs are launced. The log files will not have a maximum size and will continue to grow until the Wrapper or a JVM is restarted.

DATE – As each log entry is logged to a file,its timestamp is compared with a YYYYMMDD formatted token in the current log file. Whenever this date changes a new log file will be opened. This has the benefit of grouping all log entries for a given day in a specific file. A file will not be created on days which do not have any log output.

wrapper.logfile.maxfiles看起来很有趣也很相关.

原文链接:https://www.f2er.com/centos/373664.html

猜你在找的CentOS相关文章