-
Notifications
You must be signed in to change notification settings - Fork 41
Send milliseconds in timestamp to Logstash. Reduce dependencies. Add TCP (+optional SSL) #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
README.md
Outdated
| * **level**: Atom. Minimum level for this backend. | ||
| * **type**: String.t. Type of logs. Useful to filter in logstash. | ||
| * **timezone**: String.t. Server timezone. Used to convert from naive timestamp. Default `"Etc/UTC"`. | ||
| * **json_encoder**: Atom. Module to be used for JSON encoding. Default `Jason`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Jason is only in the :dev environment, should we add a note to include it in dependency list if they haven't already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've also removed it from the dev dependencies (so now it's only in test) so that nobody deploys a broken system to production by accident.
| @@ -1,14 +1,17 @@ | |||
| %{"certifi": {:hex, :certifi, "0.7.0", "861a57f3808f7eb0c2d1802afeaae0fa5de813b0df0979153cbafcd853ababaf", [:rebar3], []}, | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you run mix do deps.unlock --unused, deps.clean --unused it should clean this file up a lot. I don't know if it matters having unused deps in the mix.lock file or not though.
|
I've since updated my |
|
And now also updated to gracefully handle not being able to reach logstash (so your whole app doesn't crash if logstash is down for whatever reason). |
The default value for connection timeout is infinity, in my case it was waiting for an hour before giving up, which is an awfully long time.
|
I've updated this further to add some timeouts. We were having issues where a new deploy of our app wasn't detecting a closed connection for an hour before it crashed and re-opened the connection. That should happen much quicker now. |
|
Hi @marcelog, I've just been adding to and improving this PR as I go along, any chance you'll be able to find some time to review it soon? |
I installed this yesterday and noticed that the milliseconds were missing from all my timestamps. This PR fixes that issue. I've also modernized the date / time handling code and made the JSON encoder module configurable (also changed the default to
Jason).I've updated the TravisCI config to remove Elixir 1.3.0 from the build targets.