View | Details | Raw Unified | Return to bug 220246 | Differences between
and this patch

Collapse All | Expand All

(-)b/usr.sbin/syslogd/syslogd.8 (-2 / +11 lines)
Lines 269-282 The values Link Here
269
.Ar bsd
269
.Ar bsd
270
and
270
and
271
.Ar rfc3164
271
.Ar rfc3164
272
are used to generate RFC 3164 log messages.
272
are used to generate legacy RFC 3164 log messages.
273
The values
274
.Ar strict
275
and
276
.Ar rfc3164-strict
277
are used to generate log messages using the RFC 3164 recommended format,
278
where messages sent over the network include the hostname,
279
and messages forwarded by a relay exclude the
280
.Dq Forwarded from
281
field.
273
The values
282
The values
274
.Ar syslog
283
.Ar syslog
275
and
284
and
276
.Ar rfc5424
285
.Ar rfc5424
277
are used to generate RFC 5424 log messages,
286
are used to generate RFC 5424 log messages,
278
having RFC 3339 timestamps with microsecond precision.
287
having RFC 3339 timestamps with microsecond precision.
279
The default is to generate RFC 3164 log messages.
288
The default is to generate legacy RFC 3164 log messages.
280
.It Fl o
289
.It Fl o
281
Prefix kernel messages with the full kernel boot file as determined by
290
Prefix kernel messages with the full kernel boot file as determined by
282
.Xr getbootfile 3 .
291
.Xr getbootfile 3 .
(-)b/usr.sbin/syslogd/syslogd.c (-1 / +9 lines)
Lines 421-426 static bool KeepKernFac; /* Keep remotely logged kernel facility */ Link Here
421
static bool	needdofsync = true; /* Are any file(s) waiting to be fsynced? */
421
static bool	needdofsync = true; /* Are any file(s) waiting to be fsynced? */
422
static struct pidfh *pfh;
422
static struct pidfh *pfh;
423
static bool	RFC3164OutputFormat = true; /* Use legacy format by default. */
423
static bool	RFC3164OutputFormat = true; /* Use legacy format by default. */
424
static bool	RFC3164OutputFormatStrict = false; /* Use recommended format. */
424
425
425
struct iovlist;
426
struct iovlist;
426
427
Lines 722-727 main(int argc, char *argv[]) Link Here
722
			else if (strcmp(optarg, "syslog") == 0 ||
723
			else if (strcmp(optarg, "syslog") == 0 ||
723
			    strcmp(optarg, "rfc5424") == 0)
724
			    strcmp(optarg, "rfc5424") == 0)
724
				RFC3164OutputFormat = false;
725
				RFC3164OutputFormat = false;
726
			else if (strcmp(optarg, "strict") == 0 ||
727
			    strcmp(optarg, "rfc3164-strict") == 0)
728
				RFC3164OutputFormat = RFC3164OutputFormatStrict = true;
725
			else
729
			else
726
				usage();
730
				usage();
727
			break;
731
			break;
Lines 2053-2059 fprintlog_rfc3164(struct filed *f, const char *hostname, const char *app_name, Link Here
2053
		iovlist_append(&il, priority_number);
2057
		iovlist_append(&il, priority_number);
2054
		iovlist_append(&il, ">");
2058
		iovlist_append(&il, ">");
2055
		iovlist_append(&il, timebuf);
2059
		iovlist_append(&il, timebuf);
2056
		if (strcasecmp(hostname, LocalHostName) != 0) {
2060
		if (RFC3164OutputFormatStrict) {
2061
			iovlist_append(&il, " ");
2062
			iovlist_append(&il, hostname);
2063
		}
2064
		else if (strcasecmp(hostname, LocalHostName) != 0) {
2057
			iovlist_append(&il, " Forwarded from ");
2065
			iovlist_append(&il, " Forwarded from ");
2058
			iovlist_append(&il, hostname);
2066
			iovlist_append(&il, hostname);
2059
			iovlist_append(&il, ":");
2067
			iovlist_append(&il, ":");

Return to bug 220246