logging: Introduce Log::default_logdir deprecate LogAscii::logdir and per writer logdir

Also modify FormatRotationPath to keep rotated logs within
Log::default_logdir unless the rotation function explicitly
set dir, e.g. by when the user redef'ed default_rotation_interval.
This commit is contained in:
Arne Welzel 2022-06-30 16:07:04 +02:00
parent 513ea7e04f
commit aaa47a709c
15 changed files with 272 additions and 5 deletions

View file

@ -26,6 +26,13 @@ export {
## Default writer to use if a filter does not specify anything else.
const default_writer = WRITER_ASCII &redef;
## Default logging directory. An empty string implies using the
## current working directory.
## This directory is also used for rotated logs in cases where
## :zeek:see:`Log::rotation_format_func` returns a record with
## an empty or unset ``dir`` field.
const default_logdir = "" &redef;
## Default separator to use between fields.
## Individual writers can use a different value.
const separator = "\t" &redef;