elki-project / elki

ELKI Data Mining Toolkit
https://elki-project.github.io/
GNU Affero General Public License v3.0
780 stars 321 forks source link

Could not find logging configuration file "logging.properties" in version 0.7.1 #58

Closed aguslarla closed 5 years ago

aguslarla commented 5 years ago

Hi! I apologise for disturbing if i am wrong for openning this issue here.

I am using Elki v.0.7.1 library in my project and i am obtain the message in subject issue. I have checked the library and the "logging.properties" file exists.

I attach two screenshots with the issue.

I hope your answer. Thanks a lot. error_elki elki_library

kno10 commented 5 years ago

As you noticed, the file is where it is supposed to be, so I don't think ELKI is to blame here.

But you most likely have a modified class loader setup, and that is where the problem supposedly is.

aguslarla commented 5 years ago

Hi Erich!

Thanks for your fast answer. I am going to review my code carefully but at simple view, i don´t see nothing wrong.

kno10 commented 5 years ago

It likely is not obvious in the code; but rather a question of how it is launched (in particular, of the classpath and class loader). For example, building fat jars could break this. The screenshot you shared indicate that there is at least some other logging framework loaded that could also cause interference.

The packaged logging.properties is loaded via ClassLoader.getSystemResourceAsStream, and that can break with custom class loading.

https://github.com/elki-project/elki/blob/6f1d3995960e5ce3e468b1e9e8cf202263c12ba7/elki/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingConfiguration.java#L158

In the latest version 0.7.5, this will use the classes own classloader, which is much more reliable:

https://github.com/elki-project/elki/blob/474659eba15a27525db5f4c76162f28a7f1733aa/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingConfiguration.java#L158-L159

As a workaround you can simply try to provide a customized logging.properties file.