filog
filog copied to clipboard
Split context by source, identify source
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
},
}
}
Follow implementation on #67