Skip to content

Commit

Permalink
Add log message for log rotate; update docs
Browse files Browse the repository at this point in the history
refs #6737
  • Loading branch information
Michael Friedrich committed Apr 24, 2019
1 parent f923ee3 commit df25b18
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
19 changes: 16 additions & 3 deletions doc/14-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,22 @@ By default file the `mainlog` feature is enabled. When running Icinga 2
on a terminal log messages with severity `information` or higher are
written to the console.

Packages will install a configuration file for logrotate on supported
platforms. This configuration ensures that the `icinga2.log`, `error.log` and
`debug.log` files are rotated on a daily basis.
### Log Rotation <a id="logging-logrotate"></a>

Packages provide a configuration file for [logrotate](https://linux.die.net/man/8/logrotate)
on Linux/Unix. Typically this is installed into `/etc/logrotate.d/icinga2`
and modifications won't be overridden on upgrade.

Instead of sending the reload HUP signal, logrotate
sends the USR1 signal to notify the Icinga daemon
that it has rotate the log file. Icinga reopens the log
files then:

* `/var/log/icinga2/icinga2.log` (requires `mainlog` enabled)
* `/var/log/icinga2/debug.log` (requires `debuglog` enabled)
* `/var/log/icinga2/erorr.log`

By default, log files will be rotated daily.

## DB IDO <a id="db-ido"></a>

Expand Down
3 changes: 3 additions & 0 deletions lib/base/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,9 @@ void Application::SigIntTermHandler(int signum)
*/
void Application::SigUsr1Handler(int)
{
Log(LogInformation, "Application")
<< "Received USR1 signal, reopening application logs.";

RequestReopenLogs();
}

Expand Down

0 comments on commit df25b18

Please sign in to comment.