Rotation of query log

Hi!

After enabling pt-agent daemon our server is producing large amount of slow query logs. Unfortunately after sending data to Percona Cloud servers, logs are rotated with current timestamp and not deleted. This is quite big problem as logs are stored on SSD drive. I wonder why there’s no option in pt-agent to delete unneeded logs?

I could write cron script to delete old logs, but there’s another question if it’s safe to delete all rotated logs or maybe the latest file may be still processed by some tool.

Thanks,
Piotr

Hi,

There is an option for auto-removal the slow logs, but you set it on the PCT web UI - Agents → expand the details by the agent name → Services → “Remove old slow logs” checkbox.
You can also rate limit the amount of log entries get logged to limit the size of logs on disk - the “Log slow rate limit”
More details: [url]Slow Query Log

Thanks, I’ve missed that one, now it works.

Dzięki za pomoc! :slight_smile:

Piotr