Currently, our project's log format is like:
www.abcdef.com`3`1s
I want to use Go to rewrite project and import zap as log tool. By zap the log's format is like:
{"url": "www.abcdef.com", "attempt": 3, "backoff": "1s"}
I google its usage, but I don't find out any way that changes zap's format to above mentioned, so I want to seek some advice here.
zapcore
support a struct EncoderConfig. When I set matter keys empty value, zap doesn't record info of these keys. Config is like this:cfg := zapcore.EncoderConfig{ TimeKey: "", LevelKey: "", NameKey: "", CallerKey: "", MessageKey: "M", StacktraceKey: "" }
Anyway, thank you very much for your answer! – Malay