I'm trying to configure my spring-boot-app to log properly to GKE and display the levels correctly. Currently I get:
{
"textPayload": "[2023-02-27 13:48:15:099] [utility-service-v1] [,,] [WARN ] - [ main] org.hibernate.orm.deprecation - HHH90000026: PostgreSQL94Dialect has been deprecated; use org.hibernate.dialect.PostgreSQLDialect instead",
"insertId": "4lv0e5rnu1p",
},
"timestamp": "2023-02-27T13:48:15.100214978Z",
"severity": "INFO",
}
You can see the severity shows up as INFO
even though the log level is WARN
. The only way I've been able to correctly get the log level to display, is to configure the logs to be JSON format, however, then viewing the logs in kubectl is useless.
My current configuration for logs is only:
pattern:
console: "[%d{yyy-MM-dd HH:mm:ss:SSS}] [${spring.application.name}] [%X{traceId},%X{spanId},%X{spanExportable}] [%-5level] - [%15.15t] %-30.30c{1.} - %m%n"
This is on SB 3.0.2 with spring-cloud-gcp 4.1.1. I've tried with/without spring-cloud-gcp-starter-logging which didn't seem to make a difference. Any thoughts on how to get google to properly read the log level while still having the logs easily readable?