prestodb / airlift

Airlift framework for building REST services
Apache License 2.0
1 stars 42 forks source link

Conflict between 'log.output-file' and 'log.path' properties #70

Open Akanksha-kedia opened 9 months ago

Akanksha-kedia commented 9 months ago

Motivation: While configuring Presto, I encountered an issue where the 'log.output-file' property conflicts with the 'log.path' property. Both properties are trying to set the log file's location, but they're given different values.

Details: The error message I received was:

Error: Configuration property 'log.output-file' (=/Users/akanksha/Documents/PrestoRuntime/data/var/log/server.log) conflicts with property 'log.path' (=~/Downloads/server.log)

com.google.inject.ConfigurationException: Guice configuration errors:

1) Error: Configuration property 'log.output-file' (=/Users/akanksha/Documents/PrestoRuntime/data/var/log/server.log) conflicts with property 'log.path' (=~/Downloads/server.log) but loggingConfiguration has : public String getLogPath() { return logPath; } The method setLogPath(String logPath) is annotated with both @LegacyConfig("log.output-file") and @Config("log.path"). This means it can be configured with either 'log.output-file' or 'log.path'. However, it seems there should only be one of them in the configuration file, not both.

Proposed Solution: As 'log.output-file' is marked as a legacy configuration, it might be better to recommend using the 'log.path' property in the error message. Moreover, if 'log.output-file' is no longer recommended, it might be worth considering its deprecation or removal in future versions. 503 60108 1 0 5:55PM ?? 0:06.28 java -cp /opensourceoct/prestodb/target/presto-server-0.285-SNAPSHOT 2/lib/* -server -Xmx16G -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError -Djava.io.tmpdir=/data/dir/ -Dnode.environment=production -Dnode.id=ffffffff-ffff-ffff-ffff-ffffffffffff -Dnode.data-dir=/data/dir/ -Dlog.levels-file=/opensourceoct/prestodb/target/presto-server-0.285-SNAPSHOT 2/etc/log.properties -Dlog.output-file=/Users/akanksha/Documents/PrestoRuntime/data/var/log/server.log -Dlog.enable-console=false -Dconfig=/Users/akanksha/opensourceoct/prestodb/target/presto-server-0.285-SNAPSHOT 2/etc/config.properties com.facebook.presto.server.PrestoServer

Akanksha-kedia commented 9 months ago

@imjalpreet please review.