papertrail / remote_syslog_logger

Ruby Logger that sends directly to a remote syslog endpoint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default :local_hostname should be FQDN

jscheid opened this issue · comments

RFC 5424 says that the hostname should be fully-qualified. The default hostname is currently determined using Socket.gethostname, which returns the unqualified hostname. It should use something like this instead to determine the FQDN.

Good catch, @jscheid. There's two mitigating reasons not to change that I'd welcome your thoughts on, namely:

  • compatibility with syslog daemons often used for sending OS logs (concurrent with this gem). rsyslog, at least in older versions, actually uses the first entry for 127.0.0.1 in /etc/hosts. That's typically not qualified.
  • not changing sender identifiers underneath existing users when they upgrade

You're always going to be incompatible with somebody, in fact what prompted this ticket was the fact that logback has the FQDN hardwired.

I understand you don't want to change the default behaviour (and I reckon you don't want to bump the major version just for this). How about a new parameter :use_fqdn that defaults to false?

Seems reasonable to me. Any interest in implementing this?

Great. Sure, but it would be nice to get my other PR out of the way first. Is there anything holding it up?

I agree. The only thing it's blocking on is having enough time to give it the thoughtful review (with an eye towards unexpected consequences) that it deserves. I can't commit to when that will be, but it won't be months :)

Fair enough, I know the feeling :-) Let's leave it at this for now. I might send over a PR for this as well when I find time. Thanks @troy!

Sounds good all around. Your comment kickstarted a discussion on the other PR, so you'll probably see something on that this week. I appreciate the TLC.