We have a liberty-based app on IBM Cloud and we'd like to send structured logs to the LogDNA service.
Currently, when we set com.ibm.ws.logging.message.format=json
it emits the logs in a format like this:
{
"type": "",
"host": "",
"ibm_userDir": "",
"ibm_serverName": "",
"message": "",
"ibm_threadId": "",
"ibm_datetime": "",
"module": "",
"loglevel": "",
"ibm_sequence": "",
"ext_thread": ""
}
Instead, LogDNA works best with a format like this:
{
"line": "This is an awesome log statement",
"app": "myapp",
"level": "INFO",
"env": "production",
"meta": {
"customfield": {
"nestedfield": "nestedvalue"
}
}
}
Is there a way to rename the JSON attributes emitted by liberty?