trinodb / trino-gateway

https://trinodb.github.io/trino-gateway/
Apache License 2.0
122 stars 47 forks source link

Logging configuration no longer works #346

Closed jack-o-hara closed 1 month ago

jack-o-hara commented 1 month ago

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"])
ebyhr commented 1 month ago

Please try JVM options like -Dlog.format= JSON. Setting properties will be supported in https://github.com/trinodb/trino-gateway/pull/340.

mosabua commented 1 month ago

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.

wewark commented 3 days ago

@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.

mosabua commented 2 days ago

We are close to merging the new config with serverConfig in https://github.com/trinodb/trino-gateway/pull/382 .. once that is in we will need your feedback and testing to ensure it works as documented ..