Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Structured Logs

Structured Logs

The idea behind structured logging is simple: instead of having applications write logs that need to be parsed via regular expressions into JSON objects that you index into Elasticsearch, you make the application write JSON objects directly.

Hélio Medeiros

June 06, 2017
Tweet

More Decks by Hélio Medeiros

Other Decks in Programming

Transcript

  1. 22:55:40 INFO Initializing hub 22:55:40 INFO Starting web server 22:55:42

    INFO Incoming connection from 127.0.0.1:37843 22:55:42 DEBUG Connection upgraded 22:55:42 DEBUG Receive message: “ping”
  2. INFO[06-06|22:55:40] Incoming connection component= websocket.serveWs remote= 127.0.0.1:37843 event= connection.new INFO[06-06|22:55:40]

    Connection upgraded component= websocket.serveWs remote= 127.0.0.1:37843 event= connection.upgraded DEBUG[06-06|22:55:42] Receive message component= websocket.connection remote= 127.0.0.1:37843 event= message.new message= ping
  3. { “timestamp”: “Jun 6 15:33:06 +0000”, “app”: “web”, “message”: “Receive

    Message”, “event”: “message.new”, “ip”: “127.0.0.1”, “Trace-Id”: “48e276bd-cb52-4e12- abaf-2f0fcf746786” }