README.md in remote_syslog-1.6.13 vs README.md in remote_syslog-1.6.14

- old
+ new

@@ -90,15 +90,18 @@ C:\> remote_syslog -D ## Auto-starting at boot -The gem includes sample [init files] such as [remote_syslog.init.d]. remote_syslog will -daemonize by default. You may be able to: +The gem includes sample [init files]. You may be able to: $ cp examples/remote_syslog.init.d /etc/init.d/remote_syslog +remote_syslog will daemonize by default. + +Init files: [init.d], [launchd], [supervisor], [upstart] + ## Sending messages securely ## If the receiving system supports sending syslog over TCP with TLS, you can pass the `--tls` option when running `remote_syslog`: @@ -130,10 +133,16 @@ remote_syslog sends the name of the file without a path ("mysqld.log") as the syslog tag (program name). RFCs 3164 and 5424 limit the tag to 32 characters. Longer filenames are truncated to 32 characters. +After changing the configuration file, restart `remote_syslog` using the +init script or by manually killing and restarting the process. For example: + + /etc/init.d/remote_syslog restart + + ## Advanced Configuration (Optional) Here's an [advanced config] which uses all options. ### Override hostname @@ -161,22 +170,41 @@ ### Detecting new files remote_syslog automatically detects and activates new log files that match its file specifiers. For example, `*.log` may be provided as a file specifier, and remote_syslog will detect a `some.log` file created after it was started. -Globs are re-checked every 60 seconds. Ruby's `Dir.glob` is used. +Globs are re-checked every 10 seconds. Ruby's `Dir.glob` is used. +Note: messages may be written to files in the 0-10 seconds between when the +file is created and when the periodic glob check detects it. This data is not +currently acted on, though the default behavior may change in the future. + Also, explicitly-provided filenames need not exist when `remote_syslog` is started. `remote_syslog` can be pre-configured to monitor log files which are created later (or may never be created). If globs are specified on the command-line, enclose each one in single-quotes (`'*.log'`) so the shell passes the raw glob string to remote_syslog (rather than the current set of matches). This is not necessary for globs defined in the config file. +### Log rotation + +External log rotation scripts often move or remove an existing log file +and replace it with a new one (at a new inode). The Linux standard script +[logrotate](http://iain.cx/src/logrotate/) supports a `copytruncate` config +option. With that option, `logrotate` will copy files, operate on the copies, +and truncate the original so that the inode remains the same. + +This comes closest to ensuring that programs watching these files (including +`remote_syslog`) will not be affected by, or need to be notified of, the +rotation. The only tradeoff of `copytruncate` is slightly higher disk usage +during rotation, so we recommend this option whether or not you use +`remote_syslog`. + + ### Excluding files from being sent Provide one or more regular expressions to prevent certain files from being matched. @@ -282,10 +310,28 @@ ln -s generic_name.log unique_name.log Point remote_syslog at unique_name.log. It will use that as the program name. +## Troubleshooting + +Two commands are particularly useful for observing `remote_syslog` +behavior. First, its own debugging: + + remote_syslog --debug-level DEBUG --debug-log remote_syslog.log + +This will write internal operations to the file `remote_syslog.log`. + +Second, strace or ktrace shows the interaction between `remote_syslog` +and the OS. To run `strace` against an existing `remote_syslog` instance +(process ID 12345): + + strace -fp 12345 -s 500 + +Feel free to ask questions or report bugs. + + ## 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. @@ -301,10 +347,13 @@ 5. Create a Pull Request or an [Issue][is] with a link to your branch 6. That's it! [sample config]: https://github.com/papertrail/remote_syslog/blob/master/examples/log_files.yml.example [init files]: https://github.com/papertrail/remote_syslog/blob/master/examples/ -[remote_syslog.init.d]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.init.d +[init.d]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.init.d +[launchd]: https://github.com/papertrail/remote_syslog/blob/master/examples/com.papertrailapp.remote_syslog.plist +[supervisor]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.supervisor.conf +[upstart]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.upstart.conf [advanced config]: https://github.com/papertrail/remote_syslog/blob/master/examples/log_files.yml.example.advanced [fk]: http://help.github.com/forking/ [is]: https://github.com/papertrail/remote_syslog/issues/ [Papertrail]: http://papertrailapp.com/