mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
Add a global log policy hook to the logging framework
This addresses the need for a central hook on any log write, which wasn't previously doable without a lot of effort. The log manager invokes the new Log::log_stream_policy hook prior to any filter-specific hooks. Like filter-level hooks, it may veto a log write. Even when it does, filter-level hooks still get invoked, but cannot "un-veto". Includes test cases.
This commit is contained in:
parent
50c5968c30
commit
795a7ea98e
10 changed files with 236 additions and 7 deletions
|
@ -299,6 +299,7 @@ private:
|
|||
std::vector<Stream *> streams; // Indexed by stream enum.
|
||||
int rotations_pending; // Number of rotations not yet finished.
|
||||
FuncPtr rotation_format_func;
|
||||
FuncPtr log_stream_policy_hook;
|
||||
};
|
||||
|
||||
} // namespace logging;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue