mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00
Introduce script-land variable that can be used to set logdir.
Addresses GH-772
This commit is contained in:
parent
672504e265
commit
6bde33aca7
4 changed files with 22 additions and 1 deletions
|
@ -252,6 +252,12 @@ void Ascii::InitConfigOptions()
|
|||
(const char*) BifConst::LogAscii::gzip_file_extension->Bytes(),
|
||||
BifConst::LogAscii::gzip_file_extension->Len()
|
||||
);
|
||||
|
||||
logdir.assign(
|
||||
(const char*) BifConst::LogAscii::logdir->Bytes(),
|
||||
BifConst::LogAscii::logdir->Len()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
bool Ascii::InitFilterOptions()
|
||||
|
@ -344,6 +350,9 @@ bool Ascii::InitFilterOptions()
|
|||
|
||||
else if ( strcmp(i->first, "gzip_file_extension") == 0 )
|
||||
gzip_file_extension.assign(i->second);
|
||||
|
||||
else if ( strcmp(i->first, "logdir") == 0 )
|
||||
logdir.assign(i->second);
|
||||
}
|
||||
|
||||
if ( ! InitFormatter() )
|
||||
|
@ -448,6 +457,11 @@ bool Ascii::DoInit(const WriterInfo& info, int num_fields, const threading::Fiel
|
|||
ext += gzip_file_extension.empty() ? "gz" : gzip_file_extension;
|
||||
}
|
||||
|
||||
if ( ! logdir.empty() )
|
||||
{
|
||||
fname = logdir.empty() ? fname : logdir + "/" + fname;
|
||||
}
|
||||
|
||||
fname += ext;
|
||||
|
||||
bool use_shadow = BifConst::LogAscii::enable_leftover_log_rotation && Info().rotation_interval > 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue