Closed sujit-baniya closed 2 years ago
I see that it requires custom function to be implemented for log. Can you please suggest how I can define custom writer with custom function.
gelfWriter.WriteMessage(&gelf.Message{
Short: "Detect URL",
Full: "Detect URL",
TimeUnix: float64(time.Now().Unix()),
Level: 1,
Extra: ToMap(r),
})
Works instead of
gelfWriter.Write(byteData) // it prints string
Any suggestions?
I think https://github.com/phuslu/log#user-defined-data-structure could help
I'm trying to use Graylog as writer. Instead of logging as individual field log is printed as single string field.
Graylog library: https://github.com/Graylog2/go-gelf
How would I implement it for graylog
The code I'm using is this