# No Log file rotation even when set, logs excessive size crashed server

**URL:** <https://help.nextcloud.com/t/no-log-file-rotation-even-when-set-logs-excessive-size-crashed-server/246090>\
**Category:** ℹ️ Support\
**Tags:** snap, translation, app\_api, external\_storage, smb, nc33, ldap\
**Created:** [June 21, 2026, 7:30am UTC](https://help.nextcloud.com/t/no-log-file-rotation-even-when-set-logs-excessive-size-crashed-server/246090 "2026-06-21T07:30:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![scubamuc](https://help.nextcloud.com/user_avatar/help.nextcloud.com/scubamuc/32/63165_2.png) [@scubamuc](https://help.nextcloud.com/u/scubamuc)\
**Post date:** [June 21, 2026, 8:16am UTC](https://help.nextcloud.com/t/no-log-file-rotation-even-when-set-logs-excessive-size-crashed-server/246090/3 "2026-06-21T08:16:35Z")

</div>

@Rbruce259

for posterity, it is unclear whether you have changed the default data directory. see [Change data directory](https://github.com/nextcloud-snap/nextcloud-snap/wiki/Wiki-Change-data-directory)

> [@Rbruce259](#):
>
> `"datadirectory": " ***REMOVED SENSITIVE VALUE***",`

if this is true, the logs are located there instead of the default data directory. thus you’d need to [set the path in config](https://help.nextcloud.com/t/how-to-edit-config-php-for-nextcloud-snap/218564) ` "logfile": "\/var\/snap\/nextcloud\/current\/logs\/nextcloud.log",` to where that log `file` is located for the built-in Nextcloud log rotation to work as expected.

note also, [permissions](https://github.com/nextcloud-snap/nextcloud-snap/wiki/Wiki-Change-data-directory#2-connect-media-to-snap) must be set correctly to enable log rotation. list permissions for your log file:  
`ls -al /var/snap/nextcloud/current/logs/nextcloud.log` or non-default path…  
it should look like this;  
 ![image](https://help.nextcloud.com/uploads/default/original/3X/1/a/1a9663a457ee603bd86e810d0831800dded8068d.png)

alternatively create a cronjob for log rotation or run a script:

```auto
#!/bin/bash

## system-wide logs ##
sudo journalctl --rotate && ## log rotation ##
sudo journalctl --vacuum-time=2days && ## retention in days ##
## nextcloud-snap logs default directory ##
sudo truncate -s 0 /var/snap/nextcloud/current/logs/nextcloud.log && ## truncate to clear ##
exit

```

---

_[View the full topic](https://help.nextcloud.com/t/no-log-file-rotation-even-when-set-logs-excessive-size-crashed-server/246090)._
