gemnasium / logrus-graylog-hook

Graylog hook for logrus
MIT License
87 stars 63 forks source link

TimeUnix (int64) in second should be a float64 to allow milliseconds after coma #2

Closed rawouter closed 8 years ago

rawouter commented 8 years ago

Hello Gravis,

First of all, thanks a lot for this great logrus hook!

I'm using it in a distributed application written in various language. Because of that, I need to be able to trace the logs with millisecond precision otherwise graylog will not display them in order.

I forked this project, hoping I'd be able to do a merge request, but the gelf.Writer library you are using doesn't allow the gelf.Message to be a float64, and I also had to add a modified copy of it to my fork to have this working. Hence opening this bug instead of submitting a merge request.

Here is the project: https://github.com/RaphYot/logrus-graylog-hook

I'm doing this conversion so that I can get the 3 millisecond numbers after the . separation of the TimeUnix in second:

        TimeUnix: float64(time.Now().UnixNano()/1000000) / 1000.,

Note that I also modified the README page to reflect the new repo, in the example it's still showing the legacy one.

Thanks! Raph

gravis commented 8 years ago

Hi Ralph, Sorry for the long delay. Interesting change. Do you think you can rebase and create a pull request? The github.com/SocialCodeInc/go-gelf/ repo hasn't be updated in a while but have at least some test. We could also vendor it in a gelf directory in the logrus-graylog-hook (or you can propose a pull request on github.com/SocialCodeInc/go-gelf too).

Thanks Philippe

saward commented 8 years ago

I'd be interested in seeing this included too.

gravis commented 8 years ago

merged in v2.0.0