esl / MongoosePush

MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS.
Apache License 2.0
108 stars 24 forks source link

Structured logs / Logfmt #148

Closed rslota closed 4 years ago

kmakiela commented 4 years ago

Thanks for finishing this PR @rslota. It looks good, I just have one question. The example log looks like that: when=2020-04-07T10:07:50.813 severity=warn what="action=open_connection, result=error, reason=:econnrefused" at=Elixir.Sparrow.H2Worker.start_conn/1:539 pid=#PID<0.5513.0> file=lib/sparrow/h2_worker.ex application=sparrow It seems like the what="action=open_connection, result=error, reason=:econnrefused" is formatted differently than the rest of the log (quotes, comas) and I'm not sure if this is the desired design.

rslota commented 4 years ago

Thanks for review @michalwski, @kmakiela !

Thanks for finishing this PR @rslota. It looks good, I just have one question. The example log looks like that: when=2020-04-07T10:07:50.813 severity=warn what="action=open_connection, result=error, reason=:econnrefused" at=Elixir.Sparrow.H2Worker.start_conn/1:539 pid=#PID<0.5513.0> file=lib/sparrow/h2_worker.ex application=sparrow It seems like the what="action=open_connection, result=error, reason=:econnrefused" is formatted differently than the rest of the log (quotes, comas) and I'm not sure if this is the desired design.

Indeed, but there is nothing I can do about it here. This is just sparrow returning the whole thing as "text message". We need to refactor logs in sparrow to make it work correctly.

@michalwski, I've pushed changes that address your comments.