# Rotation of query log

**URL:** https://forums.percona.com/t/rotation-of-query-log/3410
**Category:** Percona Cloud Tools
**Created:** [April 17, 2014, 7:55am UTC](https://forums.percona.com/t/rotation-of-query-log/3410 "2014-04-17T07:55:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![piotr](https://avatars.discourse-cdn.com/v4/letter/p/839c29/32.png) [@piotr](https://forums.percona.com/u/piotr)
#### Post date: [April 17, 2014, 7:55am UTC](https://forums.percona.com/t/rotation-of-query-log/3410/1 "2014-04-17T07:55:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)
#### Post date: [April 18, 2014, 1:57am UTC](https://forums.percona.com/t/rotation-of-query-log/3410/2 "2014-04-18T01:57:29Z")

</div>

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](http://www.percona.com/doc/percona-server/5.6/diagnostics/slow_extended.html#log_slow_rate_limit%5B/url%5D)

---

<div class="post-metadata">

### Author: ![piotr](https://avatars.discourse-cdn.com/v4/letter/p/839c29/32.png) [@piotr](https://forums.percona.com/u/piotr)
#### Post date: [April 19, 2014, 3:35am UTC](https://forums.percona.com/t/rotation-of-query-log/3410/3 "2014-04-19T03:35:12Z")

</div>

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

Dzięki za pomoc! 🙂

Piotr
