mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
Adding Broker ifdefs for new remote logging code.
This commit is contained in:
parent
a5e9a535a5
commit
511ca9e043
5 changed files with 16 additions and 2 deletions
|
@ -1207,7 +1207,11 @@ WriterFrontend* Manager::CreateWriter(EnumVal* id, EnumVal* writer, WriterBacken
|
|||
winfo->info->rotation_interval = winfo->interval;
|
||||
winfo->info->rotation_base = parse_rotate_base_time(base_time);
|
||||
|
||||
#ifdef ENABLE_BROKER
|
||||
winfo->writer = new WriterFrontend(*winfo->info, id, writer, local, remote, stream->remote_flags);
|
||||
#else
|
||||
winfo->writer = new WriterFrontend(*winfo->info, id, writer, local, remote, 0);
|
||||
#endif
|
||||
winfo->writer->Init(num_fields, fields);
|
||||
|
||||
InstallRotationTimer(winfo);
|
||||
|
|
|
@ -131,7 +131,7 @@ public:
|
|||
|
||||
/**
|
||||
* Create a new log writer frontend. This is exposed so that the
|
||||
* communication system can recreated remote log streams locally.
|
||||
* communication system can recreate remote log streams locally.
|
||||
*
|
||||
* @param stream The enum value corresponding the log stream.
|
||||
*
|
||||
|
@ -153,7 +153,7 @@ public:
|
|||
|
||||
/**
|
||||
* Writes out log entries that have already passed through all
|
||||
* filters, and have raised any events. This is meant called for logs
|
||||
* filters (and have raised any events). This is meant called for logs
|
||||
* received alrready processed from remote.
|
||||
*
|
||||
* @param stream The enum value corresponding the log stream.
|
||||
|
|
|
@ -119,6 +119,7 @@ bool WriterBackend::WriterInfo::Write(SerializationFormat* fmt) const
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_BROKER
|
||||
broker::data WriterBackend::WriterInfo::ToBroker() const
|
||||
{
|
||||
auto bpath = broker::record::field(path);
|
||||
|
@ -175,6 +176,7 @@ bool WriterBackend::WriterInfo::FromBroker(broker::data d)
|
|||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
WriterBackend::WriterBackend(WriterFrontend* arg_frontend) : MsgThread()
|
||||
{
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
#define LOGGING_WRITERBACKEND_H
|
||||
|
||||
#include "threading/MsgThread.h"
|
||||
|
||||
#ifdef ENABLE_BROKER
|
||||
#include "broker/Data.h"
|
||||
#endif
|
||||
|
||||
#include "Component.h"
|
||||
|
||||
|
@ -115,8 +118,11 @@ public:
|
|||
// fields. They serialize/deserialize the struct.
|
||||
bool Read(SerializationFormat* fmt);
|
||||
bool Write(SerializationFormat* fmt) const;
|
||||
|
||||
#ifdef ENABLE_BROKER
|
||||
broker::data ToBroker() const;
|
||||
bool FromBroker(broker::data d);
|
||||
#endif
|
||||
|
||||
private:
|
||||
const WriterInfo& operator=(const WriterInfo& other); // Disable.
|
||||
|
|
|
@ -214,12 +214,14 @@ void WriterFrontend::Write(int arg_num_fields, Value** vals)
|
|||
num_fields,
|
||||
vals);
|
||||
|
||||
#ifdef ENABLE_BROKER
|
||||
broker_mgr->Log(stream,
|
||||
writer,
|
||||
info->path,
|
||||
num_fields,
|
||||
vals,
|
||||
remote_flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( ! backend )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue