什么是 Ansible 日志轮换周期? [英] What’s Ansible log rotation periodicity?

查看:24
本文介绍了什么是 Ansible 日志轮换周期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ansible.cfg 中,我使用 log_path 变量来定义 Ansible 日志的保存位置.会自动生成并填充日志文件,但日志轮换似乎无效.我需要有关 Ansible 日志轮换的信息.

In ansible.cfg, I use the log_path variable to define where to save Ansible logs. A log file is generated and filled automatically but log rotation seems ineffective. I need information about Ansible logs rotation.

  • 日志什么时候轮换 - 每天,根据文件大小,......?
  • 是文件轮换还是文件内容轮换?

在 ansible.cfg 中定义 log_path 后,我运行了几次 Ansible 数周.日志已保存,但没有轮换.

After defining log_path in ansible.cfg, I ran Ansible several times for several weeks. The logs are saved but there’s no rotation.

## ansible.cfg
log_path = /my/ansible/log.path

我会有两个文件:

  • /my/ansible/log.path 包含最新的日志
  • /my/ansible/log.path.0 例如包含最旧的日志
  • /my/ansible/log.path contains latest logs
  • /my/ansible/log.path.0 for example contains oldest logs

但我只将所有日志保存在 /my/ansible/log.path 中.

but I only have all logs saved in /my/ansible/log.path.

推荐答案

如所写 这里,Ansible 没有日志轮换.

As written here, there’s no log rotation with Ansible.

# logging is off by default unless this path is defined
# if so defined, consider logrotate
#log_path = /var/log/ansible.log

这篇关于什么是 Ansible 日志轮换周期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆