Skip to content

Commit 4561586

Browse files
authored
Merge pull request #129 from cgzones/config
Configuration related tweaks
2 parents 085384d + 435d005 commit 4561586

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ systemd-netlogd reads configuration files named `/etc/systemd/netlogd.conf` and
5656
Controls whether log messages received by the systemd-netlogd daemon shall be forwarded to a unicast UDP address or multicast UDP network group in syslog RFC 5424 format. The the address string format is similar to socket units. See systemd.socket(1)
5757

5858
Protocol=
59-
Specifies whether to use udp, tcp, tls or dtls (Datagram Transport Layer Security) protocol. Defaults to udp.
59+
Specifies whether to use udp, tcp, tls or dtls (Datagram Transport Layer Security) protocol. Defaults to udp.
6060

6161
LogFormat=
6262
Specifies whether to use RFC 5424 format or RFC 3339 format. Takes one of rfc5424 or rfc3339. Defaults to rfc5424.
@@ -65,7 +65,7 @@ systemd-netlogd reads configuration files named `/etc/systemd/netlogd.conf` and
6565
Takes a directory path. Specifies whether to operate on the specified journal directory DIR instead of the default runtime and system journal paths.
6666
6767
Namespace=
68-
Takes a journal namespace identifier string as argument. If not specified the data collected by the default namespace is shown. If specified shows the log data of the specified namespace instead. If the namespace is specified as "*" data from all namespaces is shown, interleaved. If the namespace identifier is prefixed with "+" data from the specified namespace and the default namespace is shown, interleaved, but no other
68+
Takes a journal namespace identifier string as argument. If not specified the data collected by the default namespace is shown. If specified shows the log data of the specified namespace instead. If the namespace is specified as "*" data from all namespaces is shown, interleaved. If the namespace identifier is prefixed with "+" data from the specified namespace and the default namespace is shown, interleaved, but no other.
6969

7070
ConnectionRetrySec=
7171
Specifies the minimum delay before subsequent attempts to contact a Log server are made. Takes a time span value. The default unit is seconds, but other units may be specified, see systemd.time(5). Defaults to 30 seconds and must not be smaller than 1 second.

src/netlog/netlog-conf.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,28 @@ int manager_parse_config_file(Manager *m) {
216216
m->connection_retry_usec = DEFAULT_CONNECTION_RETRY_USEC;
217217
}
218218

219+
if (m->auth_mode != OPEN_SSL_CERTIFICATE_AUTH_MODE_DENY
220+
&& m->protocol != SYSLOG_TRANSMISSION_PROTOCOL_TLS
221+
&& m->protocol != SYSLOG_TRANSMISSION_PROTOCOL_DTLS)
222+
log_warning("TLSCertificateAuthMode= set but unencrypted %s connection specified.", protocol_to_string(m->protocol));
223+
224+
if (m->dir && m->namespace)
225+
log_warning("Ignoring Namespace= setting since Directory= is set.");
226+
227+
if (m->structured_data && m->syslog_structured_data)
228+
log_warning("Ignoring UseSysLogStructuredData= since StructuredData= is set.");
229+
230+
if (timestamp_is_set(m->keep_alive_time) && !m->keep_alive)
231+
log_warning("Ignoring KeepAliveTimeSec= since KeepAlive= is not set.");
232+
233+
if (m->keep_alive_interval > 0 && !m->keep_alive)
234+
log_warning("Ignoring KeepAliveIntervalSec= since KeepAlive= is not set.");
235+
236+
if (m->keep_alive_cnt > 0 && !m->keep_alive)
237+
log_warning("Ignoring KeepAliveProbes= since KeepAlive= is not set.");
238+
239+
if (m->send_buffer != 0 && (m->send_buffer < 4096 || m->send_buffer > 128 * 1024 * 1024))
240+
log_warning("SendBuffer= set to an suspicious value of %zu.", m->send_buffer);
241+
219242
return 0;
220243
}

src/netlog/netlog-manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static int manager_read_journal_input(Manager *m) {
198198
message, hostname,
199199
pid,
200200
r >= 0 ? &tv : NULL,
201-
m->structured_data ? structured_data : NULL,
201+
structured_data,
202202
m->syslog_msgid ? msgid : NULL);
203203
}
204204

src/netlog/netlog-protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int format_rfc5424(Manager *m,
150150
/* Eighth: [structured-data] */
151151
if (m->structured_data)
152152
IOVEC_SET_STRING(iov[n++], m->structured_data);
153-
else if (syslog_structured_data)
153+
else if (m->syslog_structured_data && syslog_structured_data)
154154
IOVEC_SET_STRING(iov[n++], syslog_structured_data);
155155
else
156156
IOVEC_SET_STRING(iov[n++], RFC_5424_NILVALUE);

0 commit comments

Comments
 (0)