Skip to content

Commit

Permalink
Update README to mention max_size option
Browse files Browse the repository at this point in the history
  • Loading branch information
markdascher committed Oct 10, 2018
1 parent 986442f commit 1bd44d7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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*')
Expand Down
2 changes: 1 addition & 1 deletion lib/remote_syslog_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
end
2 changes: 1 addition & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

require 'remote_syslog_logger'

require 'test/unit'
require 'test/unit'
14 changes: 7 additions & 7 deletions test/test_remote_syslog_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
end

0 comments on commit 1bd44d7

Please sign in to comment.