Skip to content

Conversation

@derekkraan
Copy link

@derekkraan derekkraan commented Apr 19, 2018

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.

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`.

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?

Copy link
Author

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], []},

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.

@derekkraan derekkraan mentioned this pull request Jun 15, 2018
@derekkraan
Copy link
Author

I've since updated my master branch to include support for TCP (with and without TLS) protocol (loosely based on #8)

@derekkraan derekkraan changed the title Send milliseconds in timestamp to Logstash. Reduce dependencies. Send milliseconds in timestamp to Logstash. Reduce dependencies. Add TCP (+optional SSL) Jun 27, 2018
@derekkraan
Copy link
Author

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.
@derekkraan
Copy link
Author

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.

@derekkraan
Copy link
Author

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?

@derekkraan derekkraan closed this Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants