# logging: Add runtime log replace upon max size limit \(\#25768\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/604eb91a6c6e490c991cfa79efafe63756bdf8d5)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 604eb91a6c6e490c991cfa79efafe63756bdf8d5

Requested commit: 604eb91a6c6e490c991cfa79efafe63756bdf8d5

Commit: 604eb91a6c6e490c991cfa79efafe63756bdf8d5

Tree: d3066b615721642b86abe86b71aebd7a4a4f2198

Author: smit

Committer: GitHub

## Message

```
logging: Add runtime log replace upon max size limit (#25768)

Closes #25638

We currently only check the log size limit at startup and move `Zed.log`
to `Zed.log.old`. If a user runs Zed for an extended period, there's no
runtime restriction on the log file size, which can cause it to grow to
several gigabytes.

This PR fixes that by tracking the log file size while writing. If it
exceeds a certain threshold, we perform the same log replace and
continue logging.

Release Notes:

- Fixed an issue where `Zed.log` could grow excessively large during
long sessions of Zed.
```

## Parents

- [472dde509f99442071cdca3eddc05d902c88281a](https://git.cafe/gitcafe/zed/commit/472dde509f99442071cdca3eddc05d902c88281a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/604eb91a6c6e490c991cfa79efafe63756bdf8d5?format=markdown)
