filog icon indicating copy to clipboard operation
filog copied to clipboard

Split context by source, identify source

Open fgm opened this issue 7 years ago • 1 comments

Introduce a SourceProcessor modifying the context handling logic to format context introduced by client processors within a context.client property, (resp. server, cordova), and introduce a top-level source property identifying the origin of the logged message, so that client-sent messages can end up structured like:

{
  "_id" : "Q2656X7y3BbdEJnHp",
  "level" : 6,
  "message" : "some message",
  "context" : {
    "message_details" : {
      "arg1" : "answer",
      "arg2" : 42,
    },
    "source": "client",
    "client" : {
      "browser" : { /*..snip.. */ },
      "routing" :  { /*..snip.. */ },
      "customprocessor" : "other data"
    },
    "server" : {
      "hostname" : "fgm-linux-figaro",
      "user" : {
        "_id" : "wEbSie2FbizumzHyf",
        "createdAt" : ISODate("2018-06-29T16:03:18.583Z"),
        "services" : {
          "customauth" : { { /*..snip */ } ,
        }
      }
    },
    "timestamp" : {
      "log" : 1531235569008,
      "store" : 1531235569008
    },
  }
}

fgm avatar Jul 11 '18 11:07 fgm

Follow implementation on #67

fgm avatar Mar 01 '19 14:03 fgm