我们在 IBM Cloud 上有一个基于自由的应用程序,我们希望将结构化日志发送到 LogDNA 服务。目前,当我们设置com.ibm.ws.logging.message.format=json
它时,它会以如下格式发出日志:
{
"type": "",
"host": "",
"ibm_userDir": "",
"ibm_serverName": "",
"message": "",
"ibm_threadId": "",
"ibm_datetime": "",
"module": "",
"loglevel": "",
"ibm_sequence": "",
"ext_thread": ""
}
相反,LogDNA 最适合使用如下格式:
{
"line": "This is an awesome log statement",
"app": "myapp",
"level": "INFO",
"env": "production",
"meta": {
"customfield": {
"nestedfield": "nestedvalue"
}
}
}
有没有办法重命名自由发出的 JSON 属性?