Our log server consumes our log messages through kubernetes pods sysout formatted in json and indexes json fields. We need to specify some predefined fields in messages, so that we can track transactions across pods. For one of our pod we use Liberty profile and have issue to configure logging for these needs.
One idea was to use log4j to send customized json message in console. But all message are corrupted by Liberty log system that handles and modifies all logs done in console. I failed to configure Liberty logging parameters (copySystemStreams = false, console log level = NO) for my needs and always have liberty modify my outputs and interleaved non json messages.
To workaround all that I used liberty consoleFormat="json" logging parameter, but this introduced unnecessary fields and also do not allow me to specify my custom fields.
Is it possible to control liberty logging and console ? What is the best way to do my use case with Liberty (and if possible Log4j)