Yeah... as of now i had to write a custom json formatter class...
class will extend the jboss jsonformatter ...
and it is overriding @before..
there I am adding those fields to parent json...
Only thing jboss does not allow to remove fields.. to now I have duplicates mdc values.. on in parent key/value... anothe in mdc key value.. which is fine for now.....
But writing this class... I had to configure with 'custom-formatter' ...
now "exception-output-type=formatted, key-overrides=[timestamp="time"]" --> which was available in /subsystem=logging/json-formatter, those i can not configure.. I guess...
because /subsystem=logging/custom-formatter does not allow exception-output-type or key-overrides keys.... only module name , class name is there..
public class CustomJsonFormatter extends JsonFormatter {
public CustomJsonFormatter() {
super();
}
@Override
public void before(final Generator generator, final ExtLogRecord record) throws Exception {
generator.add("x-request-id", record.getMdcCopy().get("x-request-id"));
generator.add("tenant_id", record.getMdcCopy().get("tenant_id"));
generator.add("user_id", record.getMdcCopy().get("user_id"));
generator.add("client_id", record.getMdcCopy().get("client_id"));
}
}