Is your feature request related to a problem? Please describe.
Add the possibility to use your own logger or another logger like logrus.
Logrus is very good for micro-services, in particular, to add fields.
It's very annoying to have two different log lines like this:
INFO[2020-01-07T21:20:13.754] start service status=test
2020-01-07 21:20:13.763897 I | Listening on [::]:41921
^C2020-01-07 21:20:17.654143 I | Received signal interrupt
2020-01-07 21:20:17.655124 I | Stopping
Describe the solution you'd like
An option Logger that can be set when defining the microservice, or another better solution ?.
Like:
service := micro.NewService(
micro.Name("service"),
micro.Logger(DEFINE_LOGGER_HERE),
)
Hi,
You can do that.
import "github.com/micro/go-micro/util/log"
log.SetLogger(YourNewLogger)
YourNewLogger must implement the interface of go-log
for structured logger please wait next few days, micro logger is updating to support any structure logger via interface
try to use latest release of micro v2
Most helpful comment
try to use latest release of micro v2