play1 icon indicating copy to clipboard operation
play1 copied to clipboard

1.7.0: Logger.access() vs application.path="."

Open JohannesBeranek opened this issue 2 years ago • 1 comments

Play version 1.7.0, tested in DEV mode

Expected Behavior

Set application.path="." or do not set application.path (defaults to "."), application.log.path="/log4j.properties", log4j.properties exists in conf/ dir -> logger config works

Actual Behavior

Logger.access() returns false, as absolute log4j.properties path does not start with "."

access() should be removed (I don't really see any benefit of access checking here, as someone who can modify the conf file has already breached the system anyway) alternatively: check against Play.applicationPath.getAbsolutePath().normalize()

Unfortunately it's not possible to work around this issue due to visibility of methods in Logger method - one could use onConfigurationRead in a plugin to manually init Logger, effictively copy&pasting LOTS of code from Logger class OR set application.path to an absolute path, but both is a step back from previous behavior.

JohannesBeranek avatar Apr 20 '22 13:04 JohannesBeranek

Issue is still open

JohannesBeranek avatar Jan 25 '23 16:01 JohannesBeranek