resgate icon indicating copy to clipboard operation
resgate copied to clipboard

Logging

Open ghost opened this issue 5 years ago • 3 comments

So far, all the logging stuff has been ignored.

The problem is that all the different golang log libraries don't share a common standard interface, so the solution would be to design a standard interface and then make an adapter for each one, similar to the way the SQL package has all the different database drivers, at the cost of not being able to use specific features to each logger package. That itself could be a big task. After a quick Google there seems to be an example which uses adapters approach here: https://goa.design/implement/logging/

ghost avatar Jul 19 '18 10:07 ghost

Yes. Logging is ignored, and needs to be improved!

Using a logger interface, such as the one you suggested by goa, is a great idea. Not sure we need to do the driver approach, as multiple loggers could easily be implemented using a MultiLogger solution similar to the io.MultiWriter.

The logger could then be passed to the resgate server as part of the Config, as well as to the NATS client when creating that one.

Of course, using custom loggers like this is only when you wrap resgate's server package in your own main package. Resgate's own package main will use standard output.

Apart from this, it needs to be decided what to log, and what levels. NATS server has trace and debug logging. I am thinking about something similar:
https://github.com/nats-io/gnatsd/blob/master/main.go#L37

Any suggestions there?

jirenius avatar Jul 24 '18 08:07 jirenius

well the best way i can contribute here it to highlight issues i have encountered on distributed systems.

  1. Logging. Want to have a central place for logs that all devices logs end up in.
  • that also gets around the current issue that i brought up and the remedy of using nomad.
  1. Log filtering You want to filter the logs.

All the above is because on distributed system you cant debug them in prod or dev unless you can do the 2 top things.

i would just standup a open tracing stack. https://github.com/opentracing/opentracing-go https://godoc.org/github.com/opentracing/opentracing-go

With open tracing, i am searching for the ability to do search retrieval on the central server. no fount it yet

ghost avatar Jul 26 '18 08:07 ghost

the other big one is open consensus.

This combines metrics with tracing ( and logs)

https://opencensus.io/roadmap/ https://godoc.org/go.opencensus.io/trace

https://github.com/go-kit/kit/blob/master/tracing/opencensus/endpoint.go

ghost avatar Jul 26 '18 08:07 ghost