Skip to content

paulhammond/remote_syslog2

 
 

Repository files navigation

remote_syslog2

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.

Migrating from remote_syslog 1

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.

Changes from remote_syslog 1

  • 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.

Installing

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

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

Reporting bugs

  1. See whether the issue has already been reported: https://github.com/papertrail/remote_syslog/issues/
  2. If you don't find one, create an issue with a repro case.

Development

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 ./...

Building

make

Contributing

Once you've made your great commits:

  1. Fork remote_syslog
  2. Create a topic branch - git checkout -b my_branch
  3. Commit the changes without changing the Rakefile or other files unrelated to your enhancement.
  4. Push to your branch - git push origin my_branch
  5. Create a Pull Request or an Issue with a link to your branch
  6. That's it!

About

Lightweight self-contained daemon for reading local files and emitting remote syslog (without using local syslog daemon)

Resources

License

Stars

Watchers

Forks

Packages

No packages published