Skip to content

Commit b56172b

Browse files
Ashraf KhamisaxilleasJulian Paul Dasmarinas
committed
Merge branch 'docs/sleep-logrotate' into 'master'
Docs: Added pre_sleep and post_sleep in logrotation See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7481 Merged-by: Ashraf Khamis <[email protected]> Approved-by: Ashraf Khamis <[email protected]> Co-authored-by: Achilleas Pipinellis <[email protected]> Co-authored-by: Julian Paul Dasmarinas <[email protected]>
2 parents f7af12c + af677e4 commit b56172b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

doc/settings/logs.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,25 @@ To manually trigger GitLab log rotation with `logrotate`, use the following comm
170170
/opt/gitlab/embedded/sbin/logrotate -fv -s /var/opt/gitlab/logrotate/logrotate.status /var/opt/gitlab/logrotate/logrotate.conf
171171
```
172172

173+
### Increase how often logrotate is triggered
174+
175+
The logrotate script triggers every 50 minutes and waits for 10 minutes before attempting to rotate the logs.
176+
177+
To modify these values:
178+
179+
1. Edit `/etc/gitlab/gitlab.rb`:
180+
181+
```ruby
182+
logrotate['pre_sleep'] = 600 # sleep 10 minutes before rotating after start-up
183+
logrotate['post_sleep'] = 3000 # wait 50 minutes after rotating
184+
```
185+
186+
1. Reconfigure GitLab:
187+
188+
```shell
189+
sudo gitlab-ctl reconfigure
190+
```
191+
173192
## UDP log forwarding
174193

175194
DETAILS:

0 commit comments

Comments
 (0)