tersesystems / terse-logback

Structured Logging, Tracing, and Observability with Logback
https://tersesystems.github.io/terse-logback/
Other
196 stars 14 forks source link

Add ringbuffer-event #64

Closed wsargent closed 5 years ago

wsargent commented 5 years ago

Dump diagnostic events as a marker inside the triggering event, using logstash-logback-encoder.

Because this depends on JSON specifically, this shouldn't be in the ringbuffer project.

The field is diagnosticEvents and contains the events formatted themselves:

{
  "@timestamp": "2019-07-30T08:53:51.019-07:00",
  "@version": "1",
  "message": "Dump all messages!",
  "logger_name": "controllers.HomeController",
  "thread_name": "application-akka.actor.default-dispatcher-4",
  "level": "ERROR",
  "level_value": 40000,
  "application.home": "/home/wsargent/work/play_hello_world",
  "tags": [
    "TS_DUMP_MARKER"
  ],
  "diagnosticEvents": [
    {
      "@timestamp": "2019-07-30T08:53:51.017-07:00",
      "@version": "1",
      "message": "event 1",
      "logger_name": "controllers.HomeController",
      "thread_name": "application-akka.actor.default-dispatcher-4",
      "level": "DEBUG",
      "level_value": 10000,
      "application.home": "/home/wsargent/work/play_hello_world",
      "tags": [
        "TS_RECORD_MARKER"
      ]
    },
    {
      "@timestamp": "2019-07-30T08:53:51.017-07:00",
      "@version": "1",
      "message": "event 2",
      "logger_name": "controllers.HomeController",
      "thread_name": "application-akka.actor.default-dispatcher-4",
      "level": "DEBUG",
      "level_value": 10000,
      "application.home": "/home/wsargent/work/play_hello_world",
      "tags": [
        "TS_RECORD_MARKER"
      ]
    },
    {
      "@timestamp": "2019-07-30T08:53:51.017-07:00",
      "@version": "1",
      "message": "event 3",
      "logger_name": "controllers.HomeController",
      "thread_name": "application-akka.actor.default-dispatcher-4",
      "level": "DEBUG",
      "level_value": 10000,
      "application.home": "/home/wsargent/work/play_hello_world",
      "tags": [
        "TS_RECORD_MARKER"
      ]
    },
    {
      "@timestamp": "2019-07-30T08:53:51.017-07:00",
      "@version": "1",
      "message": "event 4",
      "logger_name": "controllers.HomeController",
      "thread_name": "application-akka.actor.default-dispatcher-4",
      "level": "DEBUG",
      "level_value": 10000,
      "application.home": "/home/wsargent/work/play_hello_world",
      "tags": [
        "TS_RECORD_MARKER"
      ]
    }
  ]
}