Setup forwarder to dev/null if logserver should not be used (also if use rpc is on).
@@ -133,12 +133,14 @@ std::unique_ptr<Forwarder>
ConfigSubscriber::make_forwarder(Metrics& metrics)
{
std::unique_ptr<Forwarder> result;
+ if (_use_logserver) {
if (_logserver_use_rpc) {
result = std::make_unique<RpcForwarder>(metrics, _forward_filter, _supervisor, _logserver_host,
_logserver_rpc_port, 60.0, 100);
} else {
- result = _use_logserver ?
- LegacyForwarder::to_logserver(metrics, _forward_filter, _logserver_host, _logserver_port) :
+ result = LegacyForwarder::to_logserver(metrics, _forward_filter, _logserver_host, _logserver_port);
+ }
+ } else {
LegacyForwarder::to_dev_null(metrics);
}
_need_new_forwarder = false;
