Skip to content

Commit b1e00ed

Browse files
author
cortex-lp
committed
add missing doc for log retention
1 parent 046a226 commit b1e00ed

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

  • content/en/docs/2025.9/getting-started/on-premise/add-observability-to-innovation/Grafana/install-loki

content/en/docs/2025.9/getting-started/on-premise/add-observability-to-innovation/Grafana/install-loki/configure-loki.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,25 @@ If the order is incorrect:
134134
1. Select the newly created website.
135135
1. In the *Manage Website* pane, click *Restart*.
136136

137+
## Configure Log Retention
138+
139+
Grafana Loki is configured with a default retention period of 12 months for it's logs. This means that Grafana can query data up to 12 months old. Once the 12 months is reached, Loki will remove older logs.
140+
141+
If a different retention period is required then this can be set, however, it should only be set to the period that is needed otherwise excessive disk space may be used unnecessarily.
142+
143+
To change the retention period:
144+
145+
1. Open the `loki-local-config.yaml` configuration file, which is located in the folder that Loki was installed to eg `C:\ProgramData\Cortex\Observability\Loki`.
146+
1. Locate the `retention_period:` configuration value at approximately line 55.
147+
1. Set the value of the retention required in hours, e.g. 6 months would be `4380h` or 9 months would be `6570h`.
148+
1. Save the file.
149+
150+
### Re-Start the Grafana Loki Service
151+
152+
1. Open `services.msc`.
153+
1. Locate the `Loki` service.
154+
1. Right click on the service name and select `Restart`. If the service is not already running, select `Start`.
155+
137156
## Next Steps?
138157

139158
1. [Install Grafana Alloy][]

0 commit comments

Comments
 (0)