lib/remote_syslog/reader.rb in remote_syslog-1.3.0 vs lib/remote_syslog/reader.rb in remote_syslog-1.3.1

- old
+ new

@@ -26,15 +26,17 @@ end @packet.hostname = local_hostname @packet.facility = options[:facility] || 'user' @packet.severity = options[:severity] || 'notice' - @packet.tag = options[:program] || File.basename(path) || File.basename($0) + tag = options[:program] || File.basename(path) || File.basename($0) + # Make sure the tag isn't too long - if @packet.tag.length > 32 - @packet.tag = @packet.tag[0..31] + if tag.length > 32 + tag = tag[0..31] end + @packet.tag = tag end def receive_data(data) @buffer.extract(data).each do |line| transmit(line)