Update instructions and provide systemd service example.

This commit is contained in:
Mark Nellemann 2021-01-26 16:08:37 +01:00
parent c80d8a5ff8
commit 86f645f295
5 changed files with 54 additions and 10 deletions

View File

@ -1,8 +1,11 @@
# Syslog Daemon
# Simple Syslog Server
Basic syslog server written in Java. All received messages are written to *stdout*.
Basic syslog server written in Java. All received messages are written to *stdout* or optionally forwarded to another syslog server.
The syslog server is able to listen on UDP and/or TCP and parses syslog messages in either RFC5424 or RFC3164 (BSD) format. The default syslog port (514) requires you to run syslogd as root / administrator. If you do not wish to do so, you can choose a port number (with the -p flag) above 1024.
The syslog server is able to listen on UDP and/or TCP and parses syslog messages in either RFC5424 or RFC3164 (BSD) format.
The default syslog port (514) requires you to run syslogd as root / administrator.
If you do not wish to do so, you can choose a port number (with the -p flag) above 1024.
## Usage Instructions
@ -10,12 +13,21 @@ The syslog server is able to listen on UDP and/or TCP and parses syslog messages
- Run *bin/syslogd*, use the *-h* option for help :)
````
Usage: syslogd [-hV] [--[no-]tcp] [--[no-]udp] [--rfc3164] [-p=<port>]
Simple syslog server that prints messages to stdout.
Usage: syslogd [-fhV] [--[no-]ansi] [--[no-]stdout] [--[no-]tcp] [--[no-]udp]
[--rfc5424] [--forward-host=<hostname>] [--forward-port=<port>]
[-p=<port>]
Simple Syslog Server
-f, --forward Forward messages (UDP RFC-3164) [default: false].
--forward-host=<hostname>
Forward to host [default: localhost].
--forward-port=<port>
Forward to port [default: 1514].
-h, --help Show this help message and exit.
--[no-]tcp Listen on TCP, true by default.
--[no-]udp Listen on UDP, true by default.
-p, --port=<port> Listening port, 514 (privileged) by default.
--rfc3164 Parse RFC3164 syslog message, RFC5424 by default.
--[no-]ansi Output ANSI colors [default: true].
--[no-]stdout Output messages to stdout [default: true].
--[no-]tcp Listen on TCP [default: true].
--[no-]udp Listen on UDP [default: true].
-p, --port=<port> Listening port [default: 514].
--rfc5424 Parse RFC-5424 messages [default: RFC-3164].
-V, --version Print version information and exit.
````

View File

@ -46,6 +46,10 @@ ospackage {
into 'bin'
}
from('doc/') {
into 'doc'
}
from(['README.md', 'LICENSE']) {
into 'doc'
}

16
doc/readme-service.md Normal file
View File

@ -0,0 +1,16 @@
# Syslogd as a System Service
## Systemd
Edit the **syslogd.service** and provide wanted options.
To install as a systemd service, copy the **syslogd.service**
file into */etc/systemd/system/* and enable the service:
systemctl daemon-reload
systemctl enable syslogd.service
systemctl restart syslogd.service
To read log output from the service, use:
journalctl -f -u syslogd.service

12
doc/syslogd.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=Simple Syslog Service
[Service]
#User=nobody
#Group=nogroup
TimeoutStartSec=0
Restart=always
ExecStart=/opt/syslogd/bin/syslogd --forward --no-stdout
[Install]
WantedBy=default.target

View File

@ -25,7 +25,7 @@ import java.util.concurrent.Callable;
@Command(name = "syslogd",
mixinStandardHelpOptions = true,
description = "Syslog Daemon.",
description = "Simple Syslog Server",
versionProvider = biz.nellemann.syslogd.VersionProvider.class)
public class Application implements Callable<Integer>, LogListener {