mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Rename supervisor_rotation_format_func to archiver_rotation_format_func, and expose it for non-supervised setups
Closes #1463
This commit is contained in:
parent
fdf34c1f7b
commit
acfb21c5a6
1 changed files with 9 additions and 6 deletions
|
@ -22,11 +22,10 @@ redef Log::default_rotation_interval = 1 hrs;
|
|||
## Alarm summary mail interval.
|
||||
redef Log::default_mail_alarms_interval = 24 hrs;
|
||||
|
||||
@if ( Supervisor::is_supervised() )
|
||||
|
||||
redef Log::default_rotation_dir = "log-queue";
|
||||
|
||||
function supervisor_rotation_format_func(ri: Log::RotationFmtInfo): Log::RotationPath
|
||||
## This function will rotate logs in a format compatible with zeek-archiver.
|
||||
## If you're using the Supervisor framework, this function will be used,
|
||||
## if not, you can set :zeek:see:`Log::rotation_format_func` to this function.
|
||||
function archiver_rotation_format_func(ri: Log::RotationFmtInfo): Log::RotationPath
|
||||
{
|
||||
local open_str = strftime(Log::default_rotation_date_format, ri$open);
|
||||
local close_str = strftime(Log::default_rotation_date_format, ri$close);
|
||||
|
@ -35,7 +34,11 @@ function supervisor_rotation_format_func(ri: Log::RotationFmtInfo): Log::Rotatio
|
|||
return rval;
|
||||
}
|
||||
|
||||
redef Log::rotation_format_func = supervisor_rotation_format_func;
|
||||
@if ( Supervisor::is_supervised() )
|
||||
|
||||
redef Log::default_rotation_dir = "log-queue";
|
||||
|
||||
redef Log::rotation_format_func = archiver_rotation_format_func;
|
||||
|
||||
redef LogAscii::enable_leftover_log_rotation = T;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue