Logging configuration no longer works
jack-o-hara opened this issue · comments
Hi.
I’m upgrading from v4 to v9. I noticed here that logging.type: external
is now required as GW is using Airlift. I want to configure JSON logging.
The documentation says Use the log.* properties from the Trino logging properties documentation
however adding log.format: JSON
to the conf results in an error:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "log" (class io.trino.gateway.ha.conf at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.trino.gateway.ha.config.HaGatewayConfiguration["log"])
logging.format: JSON
also no longer works because it no longer uses dropwizard logging.
com..fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "format" (class io.dropwizard.logging at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.trino.gateway.ha.config.HaGatewayConfiguration["logging"]->io.dropwizard.logging.common.ExternalLoggingFactory["format"])
Please try JVM options like -Dlog.format= JSON
. Setting properties will be supported in #340.
Also note that once we are fully moved to airlift we will support a config.properties file similar to Trino .. and then all those configurations can go in there.
@jack-o-hara did this solution work for you? It doesn't work for me for some reason. set -Dlog.format=JSON
in JAVA_TOOL_OPTIONS
in the docker compose file. But it still doesn't write the logs as json as it used to.
We are close to merging the new config with serverConfig in #382 .. once that is in we will need your feedback and testing to ensure it works as documented ..