我想知道消息日志文件/var/log/messages
是如何轮换的。
我检查了/etc/logrotate.conf
文件和目录内部/etc/logrotate.d/
,但没有任何内容可以解释这种旋转。
例如:这是消息文件的一小部分:
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-1:tcp]-1> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-1:tcp]-1> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-1:tcp]-1> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-1:tcp]-1> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-2:tcp]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-2:tcp]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-2:tcp]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-2:tcp]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-2:tcp]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-2:tcp]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-2:tcp]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-2:tcp]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added datanode[tcp-2:tcp]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added JobHistoryServer[tcp-0:tcp]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added JobHistoryServer[tcp-1:tcp]-1> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added JobHistoryServer[http-2:http]-2> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added journalnode[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added journalnode[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added journalnode[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added journalnode[tcp-1:tcp]-1> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added journalnode[tcp-1:tcp]-1> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added journalnode[tcp-1:tcp]-1> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added mesos-slave[http-0:http]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added DFSZKFailoverController[tcp-0:tcp]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added DFSZKFailoverController[tcp-0:tcp]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added NodeManager[tcp-0:tcp]-0> to health table
Oct 23 04:03:29 node2 grootd: DEBUG [groot.core.healthcheck.reactor] - added NodeManager[tcp-0:tcp]-0> to health table
答案1
只需输入
sudo grep 消息 /etc/logrotate.d/*
在我的系统上这将返回
/etc/logrotate.d/rsyslog:/var/log/messages