Management framework: additional logging tweaks

Ensure the framework's log stream exists prior to using it in zeek_init(), and
use a node-is-live message similar to those in agent and controller also in
launched nodes.
This commit is contained in:
Christian Kreibich 2022-07-12 17:51:32 -07:00
parent e947e1d1c2
commit ffebf99bad
2 changed files with 4 additions and 1 deletions

View file

@ -122,7 +122,8 @@ function error(message: string)
$role=r2s[Management::role], $message=message]); $role=r2s[Management::role], $message=message]);
} }
event zeek_init() # Bump priority to ensure the log stream exists when other zeek_init handlers use it.
event zeek_init() &priority=5
{ {
if ( ! Supervisor::is_supervised() ) if ( ! Supervisor::is_supervised() )
return; return;

View file

@ -118,4 +118,6 @@ event zeek_init()
Broker::peer(epi$network$address, epi$network$bound_port, Management::connect_retry); Broker::peer(epi$network$address, epi$network$bound_port, Management::connect_retry);
Broker::subscribe(node_topic); Broker::subscribe(node_topic);
Management::Log::info(fmt("node %s is live, Broker ID %s", Cluster::node, Broker::node_id()));
} }