Remote_syslog tails one or more log files and sends syslog messages to a remote central syslog server. It generates packets itself, ignoring the system syslog daemon, so its configuration doesn't affect system-wide logging.
Uses:
- Collecting logs from servers & daemons which don't natively support syslog
- When reconfiguring the system logger is less convenient than a purpose-built daemon (e.g., automated app deployments)
- Aggregating files not generated by daemons (e.g., package manager logs)
This code is tested with the hosted log management service Papertrail and should work for transmitting to any syslog server.
remote_syslog2 is a rewrite of the ruby remote_syslog package. Not all features of the ruby version are supported, and there are some backwards incompatible changes.
Also, as of this writing, remote_syslog2 is still beta and should not be considered feature complete.
- Specifying log files on the command line is not yet supported.
- The syntax of some command-line arguments have changed slightly, though most are identical.
- Default hostname has been removed. Either the
host
config file option or the-d
invocation flag are required.
Precompiled binaries for Mac, Linux and Windows are available on the remote_syslog2 releases page.
Untar the package and copy the "remote_syslog" executable into your $PATH.
Usage of remote_syslog2:
-c, --configfile="/etc/log_files.yml": Path to config
--debug-log-cfg="": the debug log file
-d, --dest-host="": Destination syslog hostname or IP
-p, --dest-port=514: Destination syslog port
--eventmachine-tail=false: No action, provided for backwards compatibility
-f, --facility="user": Facility
--hostname="": Local hostname to send from
--log="<root>=INFO": "logging configuration <root>=INFO;first=TRACE"
--new-file-check-interval={0}: How often to check for new files
-D, --no-detach=false: Don't daemonize and detach from the terminal
--no-eventmachine-tail=false: No action, provided for backwards compatibility
--pid-file="": Location of the PID file
-s, --severity="notice": Severity
--tcp=false: Connect via TCP (no TLS)
--tls=false: Connect via TCP with TLS
- See whether the issue has already been reported: https://github.com/papertrail/remote_syslog/issues/
- If you don't find one, create an issue with a repro case.
remote_syslog2 is written in go, and uses godep to manage dependencies. To get everything set up, install go then run:
go get github.com/kr/godep
go get github.com/mitchellh/gox
go get github.com/papertrail/remote_syslog2
To run tests:
# run all tests
godep go test ./...
# run all tests except the slower syslog reconnection tests
godep go test -short ./...
make
Once you've made your great commits: