Hi All,
Sorry IF I have missed explanation for similar questions (searched a lot, but I could not find solution/explanation).
Basically, I have cluster working and few agents connected to.
Problem manifests differently on CentOS 6 and CentOS 7, although these settings are same:
log_rotate_duration = "24h"
log_file = "/var/log/consul-{timestamp}.log"
In both cases, "24h" is not used (or handled) at all: there is NO rotation of log file performed - which I would expect
CentOS 7 does not log anywhere, but to /var/log/messages
So, what are proper way to set:
- log_file so it includes timestamp (e.g.- what is proper format to get filename like /var/log/consul-YYYYDDMM.log)?
- log_rotate_duration so the log file is rotated on daily basis?
- How to make CentOS 7 version to write to log_file above?
systemd unit file used on CentOS 7 (tried without -log-file option, does not give different results):
[Unit]
Description="HashiCorp Consul - A service mesh solution"
Documentation=https://www.consul.io/docs/index.html
Requires=network-online.target
After=network-online.target
ConditionFileNotEmpty=/etc/consul.d/consul.hcl
[Service]
User=consul
Group=consul
ExecStart=/opt/consul/bin/consul agent -config-dir=/etc/consul.d/ -log-file=/var/log/consul.log
ExecReload=/opt/consul/bin/consul reload
KillMode=process
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
Any help is welcome
Best regards