Logrotate on icingaweb2.log

Hi everybody,

I am wondering about a good logroate for our icingaweb2.log.
So far I would work with:
/var/log/icingaweb2/icingaweb2.log {
weekly
rotate 4
compress
#size 500M
su root icingaweb2
create 0644 apache apache
postrotate
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
endscript
}

The size line is optional :slight_smile:
I am not quite sure about my postrotate, though. Do I need this?

With regards

René

Hello there!

I would like to ask you to reformat your post to have your log in a code block, you can find how to do that in these guidelines.

It’s a lot more readable for people who want to help, the less effort they have to put in to give an answer the more likely it is that they will!

I’ll share your post on twitter for more visibility, if you got the formatting right and want me to :slight_smile:

Have a nice day,
Feu

1 Like

Hi,

The answer depends greatly on the size of your environment.
Personally these messages are not so important thusly we do a daily rotation and just keep 3 days worth of history.

Cheers,
George

1 Like

Now with code block :slight_smile:

/var/log/icingaweb2/icingaweb2.log {
weekly
rotate 4
compress
#size 500M
su root icingaweb2
create 0644 apache apache
postrotate
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
endscript
}
2 Likes