georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

Problem with log4j2.properties from datadir #662

Closed jusabatier closed 6 months ago

jusabatier commented 8 months ago

Describe the bug The log4j2.properties file form the georchestra datadir is not loaded

I think it's due to : https://github.com/georchestra/mapstore2-georchestra/blob/59e7d1d209089aebc3af00fdc3c89d063c713c42/web/src/main/resources/log4j2.component.properties

As -Dgeorchestra.datadir expect no ending /, we sould have :

log4j.configurationFile=classpath:log4j2.properties,${sys:georchestra.datadir}/mapstore/log4j2.properties

To Reproduce Steps to reproduce the behavior:

  1. Ad a log4j2.properties file to georchestra datadir
  2. Start mapsore2

Expected behavior It should load the georchestra's datadir one over the default one

@tdipisa Is it possible to fix this in next release ?

landryb commented 6 months ago

stumbled upon the same bug, using (with the trailing slash):

log4j.configurationFile=classpath:log4j2.properties,${sys:georchestra.datadir}/mapstore/log4j2.properties

results in logs being sent to both configured paths as if both log4j2.properties configs were used. i'm not sure log4j.configurationFile has the concept of configuration file priority (at least its not specified you can give multiple values in https://logging.apache.org/log4j/2.x/faq.html#how-do-i-specify-the-configuration-file-location)

that's a regression from #625.