From 3d7d496d6168f8aa4a8eba231058296ee3a176fc Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Tue, 8 May 2007 19:12:28 -0800 Subject: [PATCH] Fix documentation. [git-p4: depot-paths = "//src/SyslogLogger/dev/": change = 3159] --- History.txt | 4 +++- lib/syslog_logger.rb | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/History.txt b/History.txt index 51d8bf5..65acddb 100644 --- a/History.txt +++ b/History.txt @@ -1,5 +1,7 @@ -== 1.4.0 / 2007-04-21 +== 1.4.0 / 2007-05-08 * Split from rails_analyzer_tools. * Added eh methods for compatibility with Logger. +* Added syslog-ng instructions. Patch by Tom Lianza. +* Fixed require in documentation. Reported by Gianni Jacklone. diff --git a/lib/syslog_logger.rb b/lib/syslog_logger.rb index 05f6e5b..911e459 100644 --- a/lib/syslog_logger.rb +++ b/lib/syslog_logger.rb @@ -11,9 +11,9 @@ # # NOTE! You can only set the SyslogLogger program name when you initialize # SyslogLogger for the first time. This is a limitation of the way -# SyslogLogger uses syslog (and in some ways, a the way syslog(3) works). -# Attempts to change SyslogLogger's program name after the first -# initialization will be ignored. +# SyslogLogger uses syslog (and in some ways, a limitation of the way +# syslog(3) works). Attempts to change SyslogLogger's program name after the +# first initialization will be ignored. # # = Sample usage with Rails # @@ -21,7 +21,7 @@ # # Add the following lines: # -# require 'production_log/syslog_logger' +# require 'syslog_logger' # RAILS_DEFAULT_LOGGER = SyslogLogger.new # # == config/environment.rb @@ -36,7 +36,9 @@ # # Other versions of Rails should have a similar change. # -# == /etc/syslog.conf +# == BSD syslog setup +# +# === /etc/syslog.conf # # Add the following lines: # @@ -46,7 +48,7 @@ # Then touch /var/log/production.log and signal syslogd with a HUP # (killall -HUP syslogd, on FreeBSD). # -# == /etc/newsyslog.conf +# === /etc/newsyslog.conf # # Add the following line: # @@ -55,6 +57,16 @@ # This creates a log file that is rotated every day at midnight, gzip'd, then # kept for 7 days. Consult newsyslog.conf(5) for more details. # +# == syslog-ng setup +# +# === syslog-ng.conf +# +# destination rails_log { file("/var/log/production.log"); }; +# filter f_rails { program("rails.*"); }; +# log { source(src); filter(f_rails); destination(rails_log); }; +# +# == Starting +# # Now restart your Rails app. Your production logs should now be showing up # in /var/log/production.log. If you have mulitple machines, you can log them # all to a central machine with remote syslog logging for analysis. Consult