Commit Graph

81 Commits

Author SHA1 Message Date
Joachim Nilsson
60239756af Reference syslogp(3) instead of native/old syslog(3) API
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 23:20:14 +01:00
Joachim Nilsson
e25f835a5a logger: Add NetBSD -m MSGID support for logging RFC5424 style
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 23:20:11 +01:00
Joachim Nilsson
f2e1793cda logger: Add NetBSD -n option for LOG_NDELAY
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 22:03:11 +01:00
Joachim Nilsson
0aa57978ee logger: Add NetBSD -i option for LOG_PID
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 21:54:47 +01:00
Joachim Nilsson
d3461fd6a3 logger: Add NetBSD -c option for LOG_CONS
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 21:08:01 +01:00
Joachim Nilsson
67723e53b9 syslogd.8: Clarify -r documentation and how it works with -b :PORT
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 19:08:29 +01:00
Joachim Nilsson
f8e87f143d syslogd: Drop -a SOCK support, replaced with multiple -p SOCK args
The -p SOCK syntax is what NetBSD syslogd use, so this is more of an
alignment with upstream.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 19:08:29 +01:00
Joachim Nilsson
533ca61faa Support for sending messages to a custom port on remote server
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-06 14:23:03 +01:00
Joachim Nilsson
449a2ea162 Minor, whitespace formatting
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-06 13:45:49 +01:00
Joachim Nilsson
fc4b804a6d Add LOG_WARN alias
Along with syslogp(), this is ia killer vendor lock-in feature.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-06 13:45:21 +01:00
Joachim Nilsson
0fd87623d5 Update syslog.conf man page with log formatting options and example
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-06 12:36:21 +01:00
Joachim Nilsson
8f582259d8 Document difference in log formats between RFC3164 and RFC5424
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 12:19:57 +01:00
Joachim Nilsson
cebec1202b Update man pages with new per-rule options and fix old paths
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 12:19:06 +01:00
Joachim Nilsson
84aa897628 Consolidate option parsing for syslog.conf rules
This patch changes the syntax for per-rule log rotation and makes it
possible to have enable log rotation and RFC5424 output formatting.

The new syntax looks like this:

    	EXPR		ACTION			;OPT,OPT,...

Example:

	*.notice	-/var/log/messages	;rotate=1M:5,RFC5424

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 12:15:05 +01:00
Joachim Nilsson
ff4f2cdb31 Replace homegrown PID file functions with std BSD pidfile()
- Import pidfile() v1.11 from OpenBSD and libite (-lite) project
- Import utimensat() replacement, for systems that don't have it
- Simplify syslogd and klogd program start and PID file creation
- Rip out -i and -I from klogd, uses old PID file functions, and
  they're only kill(1) wrappers anyway

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 21:03:28 +01:00
Joachim Nilsson
b0a3d5cdd9 Document new include /etc/syslog.d/*.conf support
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 14:13:34 +01:00
Joachim Nilsson
3ef86e98b1 Import NetBSD syslog.3 v1.33 as syslogp.3
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 11:00:15 +01:00
Joachim Nilsson
72bbee7812 syslogd: Add support for '-b :service' to bind to another port
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-30 17:08:26 +01:00
Joachim Nilsson
dfff48fb04 Convert man pages to mdoc format, remove sysklogd.8 man page
- Major cleanup, simplifications, grammar corrections
- Remove inappropriate sections
- Update syntax and add tables for facility and priority

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-30 15:56:30 +01:00
Joachim Nilsson
fc4840a698 Add support for -P pid_file, like FreeBSD syslogd
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-29 13:58:56 +01:00
Joachim Nilsson
176ba2d095 Support for logging to a file/stdout using syslog API
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-29 09:08:37 +01:00
Joachim Nilsson
4f5124cb79 Change command line option for log rotation, from -b/-c --> -R b:c
We want to use -b for binding to an address:port, like FreeBSD/NetBSD
supports using this option.  Unfortunately breaks existing setups in
the wild already.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-29 06:37:55 +01:00
Joachim Nilsson
6b07e96753 Add Emacs mode hinting, mostly for syslog.conf.5
Emacs is by default fooled into defaulting to conf-file-mode for
syslog.conf.5, so we add hinting to all man pages for consistency.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-25 16:06:36 +02:00
Joachim Nilsson
bdb1d45f90 Refactor and drop '-n' option for rotation
The '-n' option is commonly used for remote servers, so let's
consolidate the log rotation under the '-r' flag instead, with
the same syntax as previously established in syslog.conf

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-25 16:06:36 +02:00
Joachim Nilsson
1a09654e79 Add logger tool from Finit project to complement sysklogd
This patch introduces a relicensed logit from the Finit[1] project.  It
has been rebranded as logger to complement the features implemented in
the sysklogd project.

Note, logger conflicts with the tool of the same name from util-linux.

[1]: https://github.com/troglobit/finit

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-13 14:48:37 +02:00
Joachim Nilsson
ac718fe969 Document new RFC5424 style formatting for sending to remote hosts
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-12 21:37:28 +02:00
Joachim Nilsson
ea24aa5378 Usability, size modifiers to log rotate: 100k:5, 1G:3, and 100M:5
This applies to both the command line '-b SIZE' option and the
optional per log file setting.  Modifiers supported are: k, M, G

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-09-25 17:27:24 +02:00
Joachim Nilsson
141b3d5c7c Update man pages with info on new per-file log rotation settings
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-09-25 09:39:16 +02:00
Joachim Nilsson
d7bfb2c66f Activate built-in log rotation feature, disabled by default
Basically just removes the #ifdef blocks around the code.  With the
feature disabled by defult this should be safe.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-08-03 00:58:42 +02:00
Joachim Nilsson
1a42935c2f Document log rotation command line options
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-08-02 23:47:21 +02:00
Joachim Nilsson
880cb2aa4d Relocate files to man/ and src/ and change to GNU configure & build
- Relocate all source files to src/ and manual pages to man/
- Replace static Makefile with GNU configure and build system

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-08-02 22:52:40 +02:00