Hello.
I want to rotate logs from pmm-agent.
Based on documentation: pmm-agent - PMM Client agent - Percona Monitoring and Management
If you change the default log file name, reflect the change in the log rotation rules file /etc/logrotate.d/pmm-agent-logrotate
.
I’m not have this file. I had installed agent from binaries. I’m looked inside deb and rpm packages too for this file, but I not found it.
Which type of signal I can send to pmm-agent process to re-create (re-handle) new log file?
I don’t want restart the pmm-agent.
Actually I use:
ProjectName: pmm-agent
Version: 2.33.0
PMMVersion: 2.33.0
Timestamp: 2022-12-06 17:15:45 (UTC)
FullCommit: 1cc0dd29c13ca7a8fd0ea16760af48b8eba890b6
nurlan
December 7, 2023, 12:20pm
2
Hi @mariaczi ,
pmm-agent don’t create log files.
pmm-agent logs to stdout and stderr, so you can configure where to write logs when you start the process.
Hi @nurlan .
Thanks for your answer.
I’m starting pmm-agent with start-stop-daemon
command in this way:
start() {
ebegin "Starting ${name}"
start-stop-daemon \
--start --quiet --background --pidfile ${pidfile} -1 ${pmm_log} -2 ${pmm_log} \
--exec ${command} -- ${start_stop_daemon_args}
local ret=$?
eend $ret
return $ret
}
What I should send to start-stop-daemon
command to re-create log file?
nurlan
December 8, 2023, 12:19pm
4
Hi @mariaczi ,
You need to configure start-stop-daemon to write from stdout to some file(How to log the stdout of a process started by start-stop-daemon – iTecNote ) and then configure logrotate to rotate this file like it’s written here How to Setup and Manage Log Rotation Using Logrotate in Linux
I hope it’ll help you.
P.S. Regarding
If you change the default log file name, reflect the change in the log rotation rules file /etc/logrotate.d/pmm-agent-logrotate
.
We will remove this line from our documentation, it seems outdated.