From 567054da406e33af040e75c1811f514036b16683 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 31 Jul 2012 13:57:31 +0200 Subject: [PATCH 01/14] Break up for long Log messages --- lib/syslog-logger.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/syslog-logger.rb b/lib/syslog-logger.rb index 041a2ad..4277fa5 100644 --- a/lib/syslog-logger.rb +++ b/lib/syslog-logger.rb @@ -117,7 +117,9 @@ def add(severity, message = nil, progname = nil, &block) progname = @progname end end - SYSLOG.send(LEVEL_LOGGER_MAP[severity], format_message(format_severity(severity), Time.now, progname, clean(message))) + message.each_line do | msg | + SYSLOG.send(LEVEL_LOGGER_MAP[severity], format_message(format_severity(severity), Time.now, progname, clean(msg.chop))) + end true end @@ -158,4 +160,4 @@ def clean(message) return message end -end \ No newline at end of file +end From 622f23a013a51b5c48e5e70117792be7744336d5 Mon Sep 17 00:00:00 2001 From: Daniel304 Date: Tue, 31 Jul 2012 14:01:12 +0200 Subject: [PATCH 02/14] Break up for long Log messages --- lib/syslog-logger.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/syslog-logger.rb b/lib/syslog-logger.rb index 4277fa5..56fb34a 100644 --- a/lib/syslog-logger.rb +++ b/lib/syslog-logger.rb @@ -117,6 +117,8 @@ def add(severity, message = nil, progname = nil, &block) progname = @progname end end + + # breakup multiple lines into multiple syslog messages message.each_line do | msg | SYSLOG.send(LEVEL_LOGGER_MAP[severity], format_message(format_severity(severity), Time.now, progname, clean(msg.chop))) end From 937e246606cb80f73ea898decda21a1d31e80168 Mon Sep 17 00:00:00 2001 From: Daniel304 Date: Thu, 4 Oct 2012 13:40:49 +0200 Subject: [PATCH 03/14] Fix files mend --- Rakefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Rakefile b/Rakefile index a70bd24..981274b 100644 --- a/Rakefile +++ b/Rakefile @@ -11,12 +11,12 @@ rescue LoadError end jt = Jeweler::Tasks.new do |gem| - gem.name = "syslog-logger" - gem.summary = "An improved Logger replacement that logs to syslog. It is almost drop-in with a few caveats." - gem.description = "An improved Logger replacement that logs to syslog. It is almost drop-in with a few caveats." - gem.email = "teamplatform@ngmoco.com" - gem.homepage = "http://github.com/ngmoco/syslog_logger" - gem.authors = ["Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] + gem.name = "syslog-ml-logger" + gem.summary = "An improved Logger replacement that logs multiple-lines to syslog. It is almost drop-in with a few caveats." + gem.description = "An improved Logger replacement that logs multiple-lines to syslog. It is almost drop-in with a few caveats." + gem.email = "daniel304@chello.nl" + gem.homepage = "https://github.com/Daniel304/syslog-ml-logger" + gem.authors = ["Daniel van den Oord;Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] gem.files = FileList["lib/syslog-logger.rb", "lib/syslog-formatter.rb", "README.rdoc"] gem.test_files = FileList["test/test_syslog_logger.rb"] gem.has_rdoc = true From f95b81f6fd43cca7e56699648775177fa565be06 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 4 Oct 2012 15:14:17 +0200 Subject: [PATCH 04/14] add gemspec --- syslog-ml-logger.gemspec | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 syslog-ml-logger.gemspec diff --git a/syslog-ml-logger.gemspec b/syslog-ml-logger.gemspec new file mode 100644 index 0000000..4120928 --- /dev/null +++ b/syslog-ml-logger.gemspec @@ -0,0 +1,41 @@ +# Generated by jeweler +# DO NOT EDIT THIS FILE DIRECTLY +# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = "syslog-ml-logger" + s.version = "1.6.8" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["Daniel van den Oord;Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] + s.date = "2012-10-04" + s.description = "An improved Logger replacement that logs multiple-lines to syslog. It is almost drop-in with a few caveats." + s.email = "daniel304@chello.nl" + s.extra_rdoc_files = [ + "README.rdoc" + ] + s.files = [ + "README.rdoc", + "lib/syslog-formatter.rb", + "lib/syslog-logger.rb" + ] + s.homepage = "https://github.com/Daniel304/syslog-ml-logger" + s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "SyslogLogger", "--main", "README.rdoc"] + s.require_paths = ["lib"] + s.rubygems_version = "1.8.24" + s.summary = "An improved Logger replacement that logs multiple-lines to syslog. It is almost drop-in with a few caveats." + s.test_files = [ + "test/test_syslog_logger.rb" + ] + + if s.respond_to? :specification_version then + s.specification_version = 3 + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + else + end + else + end +end + From 6f10a94fd29314fcf52f183f4b63abc6b4d35543 Mon Sep 17 00:00:00 2001 From: Erwin Rohde Date: Thu, 29 Nov 2012 09:37:11 +0100 Subject: [PATCH 05/14] Split lines into multiplie lines if length > 1024 chars --- lib/syslog-logger.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/syslog-logger.rb b/lib/syslog-logger.rb index 56fb34a..4b4b6e8 100644 --- a/lib/syslog-logger.rb +++ b/lib/syslog-logger.rb @@ -8,6 +8,9 @@ class Logger::Syslog # The version of Logger::Syslog you are using. VERSION = '1.6.8' + # Max length of syslog string + MAXLENGTH = 1024 + # From 'man syslog.h': # LOG_EMERG A panic condition was reported to all processes. # LOG_ALERT A condition that should be corrected immediately. @@ -119,8 +122,10 @@ def add(severity, message = nil, progname = nil, &block) end # breakup multiple lines into multiple syslog messages - message.each_line do | msg | - SYSLOG.send(LEVEL_LOGGER_MAP[severity], format_message(format_severity(severity), Time.now, progname, clean(msg.chop))) + message.each_line do | line | + cut(line).each do |msg| + SYSLOG.send(LEVEL_LOGGER_MAP[severity], format_message(format_severity(severity), Time.now, progname, clean(msg.chop))) + end end true end @@ -162,4 +167,12 @@ def clean(message) return message end + # Cut lines in strings having a max length of 1024 + def cut(line) + msgs = [] + (0..(line.length / MAXLENGTH)).each do |i| + msgs << line[i*MAXLENGTH, MAXLENGTH] + end + return msgs + end end From f24d3f2f2523ebf2c821e79549864eb7be919c8d Mon Sep 17 00:00:00 2001 From: Erwin Rohde Date: Thu, 29 Nov 2012 09:39:02 +0100 Subject: [PATCH 06/14] Added name --- syslog-ml-logger.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syslog-ml-logger.gemspec b/syslog-ml-logger.gemspec index 4120928..32012c6 100644 --- a/syslog-ml-logger.gemspec +++ b/syslog-ml-logger.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |s| s.version = "1.6.8" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Daniel van den Oord;Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] + s.authors = ["Daniel van den Oord;Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens; Erwin Rohde"] s.date = "2012-10-04" s.description = "An improved Logger replacement that logs multiple-lines to syslog. It is almost drop-in with a few caveats." s.email = "daniel304@chello.nl" From 7d4fd3d8b51008fdb191e5e179da12b0774b7270 Mon Sep 17 00:00:00 2001 From: Erwin Rohde Date: Thu, 29 Nov 2012 14:20:05 +0100 Subject: [PATCH 07/14] Fixed error in cutting lines at 1024 characters --- lib/syslog-logger.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/syslog-logger.rb b/lib/syslog-logger.rb index 4b4b6e8..46bafd4 100644 --- a/lib/syslog-logger.rb +++ b/lib/syslog-logger.rb @@ -171,7 +171,7 @@ def clean(message) def cut(line) msgs = [] (0..(line.length / MAXLENGTH)).each do |i| - msgs << line[i*MAXLENGTH, MAXLENGTH] + msgs << line[i*MAXLENGTH, MAXLENGTH + 1] end return msgs end From ac164f64272fbb0426eee1e180012b9b83cfd6ec Mon Sep 17 00:00:00 2001 From: root Date: Fri, 30 Nov 2012 09:05:49 +0100 Subject: [PATCH 08/14] new version --- Rakefile | 2 +- VERSION | 2 +- lib/syslog-formatter.rb | 6 +++--- syslog-ml-logger.gemspec | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Rakefile b/Rakefile index 981274b..24f72a5 100644 --- a/Rakefile +++ b/Rakefile @@ -17,7 +17,7 @@ jt = Jeweler::Tasks.new do |gem| gem.email = "daniel304@chello.nl" gem.homepage = "https://github.com/Daniel304/syslog-ml-logger" gem.authors = ["Daniel van den Oord;Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] - gem.files = FileList["lib/syslog-logger.rb", "lib/syslog-formatter.rb", "README.rdoc"] + gem.files = FileList["lib/syslog-ml-logger.rb", "lib/syslog-formatter.rb", "README.rdoc"] gem.test_files = FileList["test/test_syslog_logger.rb"] gem.has_rdoc = true gem.extra_rdoc_files = ["README.rdoc"] diff --git a/VERSION b/VERSION index cfe11fd..661e7ae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.8 \ No newline at end of file +1.7.3 diff --git a/lib/syslog-formatter.rb b/lib/syslog-formatter.rb index b0420ff..dfe8b84 100644 --- a/lib/syslog-formatter.rb +++ b/lib/syslog-formatter.rb @@ -3,7 +3,7 @@ # [Time.mSec] [SeverityLabel]: message class Logger::SyslogFormatter < Logger::Formatter - Format = "[%s] [%5s]: %s\n" + Format = "[%5s]: %s\n" attr_accessor :datetime_format @@ -12,7 +12,7 @@ def initialize end def call(severity, time, progname, msg) - Format % [format_datetime(time), severity, msg2str(msg)] + Format % [severity, msg2str(msg)] end protected @@ -37,4 +37,4 @@ def msg2str(msg) end end -end \ No newline at end of file +end diff --git a/syslog-ml-logger.gemspec b/syslog-ml-logger.gemspec index 4120928..bf17fd6 100644 --- a/syslog-ml-logger.gemspec +++ b/syslog-ml-logger.gemspec @@ -5,11 +5,11 @@ Gem::Specification.new do |s| s.name = "syslog-ml-logger" - s.version = "1.6.8" + s.version = "1.7.3" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Daniel van den Oord;Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] - s.date = "2012-10-04" + s.date = "2012-10-19" s.description = "An improved Logger replacement that logs multiple-lines to syslog. It is almost drop-in with a few caveats." s.email = "daniel304@chello.nl" s.extra_rdoc_files = [ @@ -18,7 +18,7 @@ Gem::Specification.new do |s| s.files = [ "README.rdoc", "lib/syslog-formatter.rb", - "lib/syslog-logger.rb" + "lib/syslog-ml-logger.rb" ] s.homepage = "https://github.com/Daniel304/syslog-ml-logger" s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "SyslogLogger", "--main", "README.rdoc"] From 697b9e6022ee6c1494970dee019fee5200e436aa Mon Sep 17 00:00:00 2001 From: Daniel van den Oord Date: Fri, 30 Nov 2012 11:11:33 +0100 Subject: [PATCH 09/14] Now sends multiple lines when longer then 1024 characters --- lib/{syslog-logger.rb => syslog-ml-logger.rb} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename lib/{syslog-logger.rb => syslog-ml-logger.rb} (99%) diff --git a/lib/syslog-logger.rb b/lib/syslog-ml-logger.rb similarity index 99% rename from lib/syslog-logger.rb rename to lib/syslog-ml-logger.rb index 46bafd4..d2b934c 100644 --- a/lib/syslog-logger.rb +++ b/lib/syslog-ml-logger.rb @@ -6,7 +6,7 @@ class Logger::Syslog include Logger::Severity # The version of Logger::Syslog you are using. - VERSION = '1.6.8' + VERSION = '1.8' # Max length of syslog string MAXLENGTH = 1024 @@ -122,7 +122,7 @@ def add(severity, message = nil, progname = nil, &block) end # breakup multiple lines into multiple syslog messages - message.each_line do | line | + message.each_line do | msg | cut(line).each do |msg| SYSLOG.send(LEVEL_LOGGER_MAP[severity], format_message(format_severity(severity), Time.now, progname, clean(msg.chop))) end From e41377a6e71528a4842c9dc5848b358002231d3a Mon Sep 17 00:00:00 2001 From: Daniel van den Oord Date: Fri, 30 Nov 2012 11:20:51 +0100 Subject: [PATCH 10/14] Long lines split in max 1024 char lines --- README.rdoc | 13 +++++++++++-- Rakefile | 2 +- VERSION | 2 +- lib/syslog-ml-logger.rb | 2 +- syslog-ml-logger.gemspec | 11 +++-------- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/README.rdoc b/README.rdoc index 8d7f95d..66fd9b6 100644 --- a/README.rdoc +++ b/README.rdoc @@ -17,17 +17,19 @@ will be ignored. This particular Logger::Syslog improves the original by correctly mapping Rails log severities to the Syslog counterparts. It also adds the ability to select a syslog facility other than "user." +Version 1.8.0 cuts lines longer then 1024 characters in multiple lines cause syslog cuts them off +Version 1.7.3 sends multiple lines to the syslog server instead of one large line which is cut of Version 1.6.7 takes a formatter as logger does and uses call to format the message. == SYNOPSIS: === config/environment.rb - config.gem 'syslog-logger' + require 'syslog-ml-logger' === Gemfile - gem 'syslog-logger' + gem 'syslog-ml-logger' === config/environments/production.rb @@ -39,6 +41,10 @@ By default, Logger::Syslog uses the program name 'rails' and the facility 'user' changed via the arguments to Logger::Syslog.new: RAILS_DEFAULT_LOGGER = Logger::Syslog.new('mygreatapp', Syslog::LOG_LOCAL7) + +Or use when using multiple environments with multiple projects + + config.logger = Logger::Syslog.new(Rails.env + '-' + Rails.root.to_s.gsub(/\/[path-to-rails-apps]\/(.*)\/ruby/,'\1'), Syslog::LOG_LOCAL0) === BSD syslog setup @@ -90,6 +96,9 @@ syslogd(8) manpage for further details. == LICENSE: +Extending below with: +Copyright (c) 2012, Daniel van den Oord + Copyright (c) 2008, 2009 Eric Hodel, Christopher Powell, Ian Lesperance, Dana Contreras, Brian Smith, Ashley Martens diff --git a/Rakefile b/Rakefile index 24f72a5..a8e5cc3 100644 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,7 @@ jt = Jeweler::Tasks.new do |gem| gem.description = "An improved Logger replacement that logs multiple-lines to syslog. It is almost drop-in with a few caveats." gem.email = "daniel304@chello.nl" gem.homepage = "https://github.com/Daniel304/syslog-ml-logger" - gem.authors = ["Daniel van den Oord;Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] + gem.authors = ["Daniel van den Oord;Erwin Rohde,Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] gem.files = FileList["lib/syslog-ml-logger.rb", "lib/syslog-formatter.rb", "README.rdoc"] gem.test_files = FileList["test/test_syslog_logger.rb"] gem.has_rdoc = true diff --git a/VERSION b/VERSION index 661e7ae..27f9cd3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.3 +1.8.0 diff --git a/lib/syslog-ml-logger.rb b/lib/syslog-ml-logger.rb index d2b934c..64166d5 100644 --- a/lib/syslog-ml-logger.rb +++ b/lib/syslog-ml-logger.rb @@ -6,7 +6,7 @@ class Logger::Syslog include Logger::Severity # The version of Logger::Syslog you are using. - VERSION = '1.8' + VERSION = '1.8.0' # Max length of syslog string MAXLENGTH = 1024 diff --git a/syslog-ml-logger.gemspec b/syslog-ml-logger.gemspec index 40ef248..a58935e 100644 --- a/syslog-ml-logger.gemspec +++ b/syslog-ml-logger.gemspec @@ -5,16 +5,11 @@ Gem::Specification.new do |s| s.name = "syslog-ml-logger" - s.version = "1.7.3" + s.version = "1.8.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= -<<<<<<< HEAD - s.authors = ["Daniel van den Oord;Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] - s.date = "2012-10-19" -======= - s.authors = ["Daniel van den Oord;Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens; Erwin Rohde"] - s.date = "2012-10-04" ->>>>>>> 7d4fd3d8b51008fdb191e5e179da12b0774b7270 + s.authors = ["Daniel van den Oord;Erwin Rohde,Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] + s.date = "2012-11-30" s.description = "An improved Logger replacement that logs multiple-lines to syslog. It is almost drop-in with a few caveats." s.email = "daniel304@chello.nl" s.extra_rdoc_files = [ From 6ca245329c9a977978f44a79c29497238b994bca Mon Sep 17 00:00:00 2001 From: Daniel van den Oord Date: Fri, 30 Nov 2012 11:27:13 +0100 Subject: [PATCH 11/14] Rdoc updated --- README.rdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rdoc b/README.rdoc index 66fd9b6..b3b191f 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,6 +1,6 @@ -= SyslogLogger += SyslogMlLogger -http://github.com/ngmoco/sysloglogger +http://github.com/Daniel304/syslog-ml-logger == DESCRIPTION: @@ -17,8 +17,8 @@ will be ignored. This particular Logger::Syslog improves the original by correctly mapping Rails log severities to the Syslog counterparts. It also adds the ability to select a syslog facility other than "user." -Version 1.8.0 cuts lines longer then 1024 characters in multiple lines cause syslog cuts them off -Version 1.7.3 sends multiple lines to the syslog server instead of one large line which is cut of +Version 1.8.0 cuts lines longer then 1024 characters in multiple lines cause syslog cuts them off. +Version 1.7.3 sends multiple lines to the syslog server instead of one large line which is cut of. Version 1.6.7 takes a formatter as logger does and uses call to format the message. == SYNOPSIS: From 388aea20bab18ea8e840fe5617db3b989199a40d Mon Sep 17 00:00:00 2001 From: Daniel van den Oord Date: Fri, 30 Nov 2012 11:28:49 +0100 Subject: [PATCH 12/14] Added rubygems link for github --- README.rdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rdoc b/README.rdoc index b3b191f..bb2ac9d 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,6 +1,7 @@ = SyslogMlLogger http://github.com/Daniel304/syslog-ml-logger +http://rubygems.org/gems/syslog-ml-logger == DESCRIPTION: From 1c6171d58090ab5c3171b9caf94117b2874b11b5 Mon Sep 17 00:00:00 2001 From: Daniel van den Oord Date: Fri, 30 Nov 2012 13:37:27 +0100 Subject: [PATCH 13/14] Updated documents and stuff --- README.rdoc | 1 + Rakefile | 2 +- VERSION | 2 +- lib/syslog-formatter.rb | 9 --------- lib/syslog-ml-logger.rb | 4 ++-- syslog-ml-logger.gemspec | 2 +- 6 files changed, 6 insertions(+), 14 deletions(-) diff --git a/README.rdoc b/README.rdoc index bb2ac9d..a3f756b 100644 --- a/README.rdoc +++ b/README.rdoc @@ -18,6 +18,7 @@ will be ignored. This particular Logger::Syslog improves the original by correctly mapping Rails log severities to the Syslog counterparts. It also adds the ability to select a syslog facility other than "user." +Version 1.8.1 fixed missing last character thanks to fork of scambra. Version 1.8.0 cuts lines longer then 1024 characters in multiple lines cause syslog cuts them off. Version 1.7.3 sends multiple lines to the syslog server instead of one large line which is cut of. Version 1.6.7 takes a formatter as logger does and uses call to format the message. diff --git a/Rakefile b/Rakefile index a8e5cc3..6ba6d85 100644 --- a/Rakefile +++ b/Rakefile @@ -25,7 +25,7 @@ jt = Jeweler::Tasks.new do |gem| end Jeweler::GemcutterTasks.new -task :default => :package +task :default => :test $dir = File.dirname(__FILE__) diff --git a/VERSION b/VERSION index 27f9cd3..a8fdfda 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0 +1.8.1 diff --git a/lib/syslog-formatter.rb b/lib/syslog-formatter.rb index dfe8b84..14c264c 100644 --- a/lib/syslog-formatter.rb +++ b/lib/syslog-formatter.rb @@ -17,14 +17,6 @@ def call(severity, time, progname, msg) protected - def format_datetime(time) - if @datetime_format.nil? - time.strftime("%H:%M:%S.") << "%06d " % time.usec - else - time.strftime(@datetime_format) - end - end - def msg2str(msg) case msg when ::String @@ -36,5 +28,4 @@ def msg2str(msg) msg.inspect end end - end diff --git a/lib/syslog-ml-logger.rb b/lib/syslog-ml-logger.rb index 64166d5..144a81e 100644 --- a/lib/syslog-ml-logger.rb +++ b/lib/syslog-ml-logger.rb @@ -6,7 +6,7 @@ class Logger::Syslog include Logger::Severity # The version of Logger::Syslog you are using. - VERSION = '1.8.0' + VERSION = '1.8.1' # Max length of syslog string MAXLENGTH = 1024 @@ -124,7 +124,7 @@ def add(severity, message = nil, progname = nil, &block) # breakup multiple lines into multiple syslog messages message.each_line do | msg | cut(line).each do |msg| - SYSLOG.send(LEVEL_LOGGER_MAP[severity], format_message(format_severity(severity), Time.now, progname, clean(msg.chop))) + SYSLOG.send(LEVEL_LOGGER_MAP[severity], format_message(format_severity(severity), Time.now, progname, clean(msg))) end end true diff --git a/syslog-ml-logger.gemspec b/syslog-ml-logger.gemspec index a58935e..0c122b6 100644 --- a/syslog-ml-logger.gemspec +++ b/syslog-ml-logger.gemspec @@ -5,7 +5,7 @@ Gem::Specification.new do |s| s.name = "syslog-ml-logger" - s.version = "1.8.0" + s.version = "1.8.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Daniel van den Oord;Erwin Rohde,Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] From a82655bcb6cf318e41ff1cc8bdf37010e5c009b5 Mon Sep 17 00:00:00 2001 From: Daniel van den Oord Date: Tue, 4 Dec 2012 14:39:54 +0100 Subject: [PATCH 14/14] fixed some array stuff --- Manifest | 4 ++-- README.rdoc | 3 ++- Rakefile | 2 +- VERSION | 2 +- lib/syslog-ml-logger.rb | 4 ++-- syslog-ml-logger.gemspec | 4 ++-- test/test_syslog_logger.rb | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Manifest b/Manifest index 25caa14..8d611f2 100644 --- a/Manifest +++ b/Manifest @@ -1,7 +1,7 @@ -lib/syslog-logger.rb +lib/syslog-ml-logger.rb lib/syslog-formatter.rb Manifest Rakefile README.rdoc -syslog-logger.gemspec +syslog-ml-logger.gemspec test/test_syslog_logger.rb diff --git a/README.rdoc b/README.rdoc index a3f756b..3d5b10d 100644 --- a/README.rdoc +++ b/README.rdoc @@ -18,7 +18,8 @@ will be ignored. This particular Logger::Syslog improves the original by correctly mapping Rails log severities to the Syslog counterparts. It also adds the ability to select a syslog facility other than "user." -Version 1.8.1 fixed missing last character thanks to fork of scambra. +Version 1.8.2 quick fix +Version 1.8.1 fixed missing last character thanks to fork of scambra and undefined method each-line when message isn't an array. Version 1.8.0 cuts lines longer then 1024 characters in multiple lines cause syslog cuts them off. Version 1.7.3 sends multiple lines to the syslog server instead of one large line which is cut of. Version 1.6.7 takes a formatter as logger does and uses call to format the message. diff --git a/Rakefile b/Rakefile index 6ba6d85..375a92f 100644 --- a/Rakefile +++ b/Rakefile @@ -42,6 +42,6 @@ task :publish => [ :test, :build ] do system "git tag v#{jt.jeweler.version}" system "git push origin v#{jt.jeweler.version}" system "git push origin master" - system "gem push pkg/syslog-logger-#{jt.jeweler.version}.gem" + system "gem push pkg/syslog-ml-logger-#{jt.jeweler.version}.gem" system "git clean -fd" end diff --git a/VERSION b/VERSION index a8fdfda..53adb84 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.1 +1.8.2 diff --git a/lib/syslog-ml-logger.rb b/lib/syslog-ml-logger.rb index 144a81e..162b5d6 100644 --- a/lib/syslog-ml-logger.rb +++ b/lib/syslog-ml-logger.rb @@ -6,7 +6,7 @@ class Logger::Syslog include Logger::Severity # The version of Logger::Syslog you are using. - VERSION = '1.8.1' + VERSION = '1.8.2' # Max length of syslog string MAXLENGTH = 1024 @@ -122,7 +122,7 @@ def add(severity, message = nil, progname = nil, &block) end # breakup multiple lines into multiple syslog messages - message.each_line do | msg | + message.each do | line | cut(line).each do |msg| SYSLOG.send(LEVEL_LOGGER_MAP[severity], format_message(format_severity(severity), Time.now, progname, clean(msg))) end diff --git a/syslog-ml-logger.gemspec b/syslog-ml-logger.gemspec index 0c122b6..2e9d122 100644 --- a/syslog-ml-logger.gemspec +++ b/syslog-ml-logger.gemspec @@ -5,11 +5,11 @@ Gem::Specification.new do |s| s.name = "syslog-ml-logger" - s.version = "1.8.1" + s.version = "1.8.2" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Daniel van den Oord;Erwin Rohde,Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens"] - s.date = "2012-11-30" + s.date = "2012-12-04" s.description = "An improved Logger replacement that logs multiple-lines to syslog. It is almost drop-in with a few caveats." s.email = "daniel304@chello.nl" s.extra_rdoc_files = [ diff --git a/test/test_syslog_logger.rb b/test/test_syslog_logger.rb index d768f76..d4cd86d 100644 --- a/test/test_syslog_logger.rb +++ b/test/test_syslog_logger.rb @@ -1,6 +1,6 @@ require 'test/unit' require 'tempfile' -require 'syslog-logger' +require 'syslog-ml-logger' module MockSyslog; end