diff --git a/README.md b/README.md index ef5e5c1..b21407a 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,10 @@ regardless of the RFC, UDP syslog packets longer than 1500 bytes would not arrive. For details or to use TCP syslog for longer messages, see [help.papertrailapp.com][troubleshoot]. +There is a `max_size` option to override this restriction, but it should only be +used in extraordinary circumstances. Oversize messages are more likely to be +fragmented and lost, with some receivers rejecting them entirely. + [rfc-limit]: https://tools.ietf.org/html/rfc3164#section-4.1 [MTU]: (https://en.wikipedia.org/wiki/Maximum_transmission_unit) [troubleshoot]: http://help.papertrailapp.com/kb/configuration/troubleshooting-remote-syslog-reachability/#message-length diff --git a/Rakefile b/Rakefile index d4f7da8..47c2fdd 100644 --- a/Rakefile +++ b/Rakefile @@ -60,8 +60,8 @@ task :coverage do sh "open coverage/index.html" end -require 'rake/rdoctask' -Rake::RDocTask.new do |rdoc| +require 'rdoc/task' +RDoc::Task.new do |rdoc| rdoc.rdoc_dir = 'rdoc' rdoc.title = "#{name} #{version}" rdoc.rdoc_files.include('README*') diff --git a/lib/remote_syslog_logger.rb b/lib/remote_syslog_logger.rb index dc18bad..9f96306 100644 --- a/lib/remote_syslog_logger.rb +++ b/lib/remote_syslog_logger.rb @@ -8,4 +8,4 @@ module RemoteSyslogLogger def self.new(remote_hostname, remote_port, options = {}) Logger.new(RemoteSyslogLogger::UdpSender.new(remote_hostname, remote_port, options)) end -end \ No newline at end of file +end diff --git a/test/helper.rb b/test/helper.rb index 1198bab..6c19385 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -9,4 +9,4 @@ require 'remote_syslog_logger' -require 'test/unit' \ No newline at end of file +require 'test/unit' diff --git a/test/test_remote_syslog_logger.rb b/test/test_remote_syslog_logger.rb index 8ad191e..5d61759 100644 --- a/test/test_remote_syslog_logger.rb +++ b/test/test_remote_syslog_logger.rb @@ -11,18 +11,18 @@ def test_logger @logger = RemoteSyslogLogger.new('127.0.0.1', @server_port) @logger.info "This is a test" - message, addr = *@socket.recvfrom(1024) - assert_match /This is a test/, message + message, _ = *@socket.recvfrom(1024) + assert_match "This is a test", message end def test_logger_multiline @logger = RemoteSyslogLogger.new('127.0.0.1', @server_port) @logger.info "This is a test\nThis is the second line" - message, addr = *@socket.recvfrom(1024) - assert_match /This is a test/, message + message, _ = *@socket.recvfrom(1024) + assert_match "This is a test", message - message, addr = *@socket.recvfrom(1024) - assert_match /This is the second line/, message + message, _ = *@socket.recvfrom(1024) + assert_match "This is the second line", message end -end \ No newline at end of file +end