Giter Club home page Giter Club logo

remote_syslog_logger's People

Contributors

dannyben avatar eric avatar markdascher avatar mbeale avatar nextmat avatar tosbourn avatar troy avatar valscion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remote_syslog_logger's Issues

Q: How can I set the facility?

Hi, how can I set the facility to LOCAL4?
Thanks !!!

In remote_syslog_logger/lib/remote_syslog_logger.rb I can see ...

require 'logger'
.
.
.
def self.new(remote_hostname, remote_port, options = {})
  Logger.new(RemoteSyslogLogger::UdpSender.new(remote_hostname, remote_port, options))
end

What option could be?

#!/usr/bin/env ruby
 
require 'aws-sdk'
require 'remote_syslog_logger'
 
logger = RemoteSyslogLogger.new('192.168.1.40', 514)                                                         
logger.info("Program started")

Support for TaggedLogging

Rails 3+ supports adding per-request tags to log entries (particularly useful for logging requests' uuid). RSL just ignores them, it seems.

Suggestion: Allow instantiation with connection string

How do we feel about allowing instantiation with a connection string?

I find myself instantiating a RemoteSyslogLogger by using several lines of code, instead of something simpler - like:

logger = RemoteSyslogLogger.new "syslog://system:[email protected]:514"

This will not only make things shorter and easier, but will have the added bonus of allowing to simply use an environment variable as the connection string, like we do with redis, database and others.

logger = RemoteSyslogLogger.new ENV['SYSLOG_URL']

Here is my monkey patch proof of concept:

require 'remote_syslog_logger'
require 'uri'

module RemoteSyslogLogger
  class << self
    alias_method :original_new, :new

    def new(*args)
      args = ['syslog://localhost:514'] if args.empty?
      if args.count == 1 and args.first.is_a? String
        uri = URI args.first
        original_new uri.host, uri.port, local_hostname: uri.user, program: uri.password
      else
        original_new *args
      end
    end
  end
end

logger0 = RemoteSyslogLogger.new '127.0.0.1', '514', local_hostname: 'myhost', program: 'myprog'
logger1 = RemoteSyslogLogger.new "syslog://system:[email protected]:514"
logger2 = RemoteSyslogLogger.new "syslog://127.0.0.1:514"
logger3 = RemoteSyslogLogger.new


logger0.info "Tadaaa 0"
logger1.info "Tadaaa 1"
logger2.info "Tadaaa 2"
logger3.info "Tadaaa 3"

Heroku UDPdump

When my sinatra app tries to send a message to Papertrail using remote_syslog_logger from Heroku I get the following error:

!! Unexpected error while processing request: can't dump UDPSocket

RemoteSyslogLogger::UdpSender error: IOError: closed stream

I have implemented RemoteSyslogLogger successfully for the most part, but with one of the implementation points I am getting this error:

RemoteSyslogLogger::UdpSender error: IOError: closed stream

without any additional details (other than "original message").

Any idea how to debug this?

For context, it happens only on my DelayedJob process, which was also set to use RemoteSyslogLogger.

Also, the configuration of the RemoteSyslogLogger seems to be ok, and I was able to even send an event manually by using DelayedJob::Worker.logger.info

More details in the question I opened in StackOverflow - with easy reproduction steps:

TCP Support

Is there anyway this could support sending overt the TCP Protocol (instead of UDP)? I want to take advantage of the larger message size.

Add timeout

Our site is having problems at the moment resolving logs.papertrailapp.com. This results in the following message being printed when trying to write to the logger:

RemoteSyslogLogger::UdpSender error: SocketError: getaddrinfo: Temporary failure in name resolution

The problem is that this only happens after 20s (system/Ruby socket timeout?) essentially bringing our entire app down.

Before I start implementing anything: what do you think about adding a 100ms (or less) timeout around sending logs?

Add support for IPv6

Would it be interest in support this plugin for IPv6? My servers are IPv6 only.

Enabling remote_syslog_logger turns on sql logging

In production.rb I have...

config.logger = ActiveSupport::TaggedLogging.new(...)
config.colorize_logging = false
config.log_level = :info

But then, I start seeing SQL statements in the logs. Adding the following will cause nil errors:

config.active_record.logger = nil

What's the recommended way to stop activerecord from outputing sql statements?

This is for a Rails legacy site running v3.2.X.

Thanks in advance.

How can I log both in remote machine & the application machine

I am running Rails4 application where I am using the remote_syslog_logger gem to do logging on Remote machine, in the same time I want to do logging in the applciation machine(Machine where my application is running). Is it possible with this gem?

UDP documentation is incorrect

The README incorrectly declares that UDP messages >1500 bytes (eg, the most common MTU) cannot be transmitted. UDP packets of arbitrary length can be transmitted via IP fragmentation. The caveat being that if any one of the fragments is not received, the entire datagram cannot be reassembled and the message is lost.

Given this, I think there should be a config option to not truncate messages (with clear warnings that this is not RFC-compliant and the larger the message, the greater the chance of it being lost in transit).

EDIT: After looking through the code, the truncation is done in the syslog_protocol gem and therefore isn't relevant here. However it would be nice to have an option to not split the message by lines.

Add support for TCP/TLS

Would like to be able to also send logs via TCP/TLS, not just UDP. Is there any reason that this is not currently supported by this library?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.