# Very large log file not rotating. How to rotate pmm-linux-metrics-42000.log?

**URL:** <https://forums.percona.com/t/very-large-log-file-not-rotating-how-to-rotate-pmm-linux-metrics-42000-log/8764>\
**Category:** PMM 1.x\
**Tags:** pmm\
**Created:** [January 13, 2021, 5:02pm UTC](https://forums.percona.com/t/very-large-log-file-not-rotating-how-to-rotate-pmm-linux-metrics-42000-log/8764 "2021-01-13T17:02:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![csheridan](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@csheridan](https://forums.percona.com/u/csheridan)\
**Post date:** [January 13, 2021, 5:02pm UTC](https://forums.percona.com/t/very-large-log-file-not-rotating-how-to-rotate-pmm-linux-metrics-42000-log/8764/1 "2021-01-13T17:02:34Z")

</div>

System: Ubuntu Server 18.04, PMM 1.17.4

My /var/log/pmm-linux-metrics-42000.log is currently 5.7G. Do I need to create a manual rotate script in /etc/logrotate.d/ or is there a configuration anywhere to manage this? There was an unseen error on the server, and it caused the log to stack up.

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [January 13, 2021, 6:46pm UTC](https://forums.percona.com/t/very-large-log-file-not-rotating-how-to-rotate-pmm-linux-metrics-42000-log/8764/2 "2021-01-13T18:46:52Z")

</div>

Hi @csheridan,

Yes, no log rotate script has provided with pmm-client package.  
You may create your own script or redirect log into the system journal.  
It can be done by just removing log redirection in the unit file /etc/systemd/system/pmm-linux-metrics-42000.service

 ![Screenshot_20210113_204305](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/e/e1733aab65ca27cc32a79c806e40cf7e5ce124bb.png)

 ![Screenshot_20210113_203904](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/3/377e68896b7019c808b97070f35811040c57a92c.png)

---

<div class="post-metadata">

**Author:** ![csheridan](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@csheridan](https://forums.percona.com/u/csheridan)\
**Post date:** [January 13, 2021, 7:13pm UTC](https://forums.percona.com/t/very-large-log-file-not-rotating-how-to-rotate-pmm-linux-metrics-42000-log/8764/3 "2021-01-13T19:13:03Z")

</div>

That was incredibly informative. I will probably create a logrotate script, since I would like to keep the log file. Thank you for the useful info!
