skynetservices / skydns1

DNS for skynet or any other service discovery
MIT License
528 stars 54 forks source link

Improve logging support #63

Closed crosbymichael closed 10 years ago

crosbymichael commented 10 years ago

Right now there are many hard coded log.X calls throughout the code base. With a lot of volume this can really add a lot of output to the log files. I'm opening this so that we can discuss options.

Currently the Go log pkg is not very way or open to extension. log.Logger is a struct, not an interface, and people usually consume the log pkg with the pkg func calls and not use the logger. It is hard to extend.

Are few options that I can think of are:

  1. Have logging by level, ERROR, DEBUG, INFO...
  2. Find or create a good logging pkg for log rotation, levels, sending to other services, etc

I think having log levels is a good idea for this project. I would also like to find a good replacement for the log pkg that is not golog ( it's super complex ).

Ideas?

crosbymichael commented 10 years ago

Looking through skynet I see you have a syslog logger with a nice interface.

https://github.com/skynetservices/skynet/blob/master/log/log.go

bketelsen commented 10 years ago

The skynet logger is really nice. we can add that if you like it. I plan on doing a lot of cleanup in Skynet proper soon. One of the things we can do is move that into a shared package and use here.

hunger commented 10 years ago

At least being able to quieten all those "Updated Service TTL:" messages would be appreciated...

hunger commented 10 years ago

Oh, forget what I said... those messages apparently come from the skydns image:-/ I just wish docker had better logging (preferably with journald support).

miekg commented 10 years ago

[ Quoting notifications@github.com in "Re: [skydns] Improve logging suppor..." ]

At least being able to quieten all those "Updated Service TTL:" messages would be appreciated...

We currently rewriting skydns to use etcd as a backend, then these messages will automatically disappear.

/Miek

Miek Gieben

miekg commented 10 years ago

Also skydns2 uses the code from etcd to do the logging.