Properties file for slf4j is not readable although on the classpath

The sl4j SimpleLogger documentation says that if you have a file named simplelogger.properties it should be loaded automatically. I can't get it to work (load). There must be something obvious I'm missing?

Simplelogger.properties content:

org.slf4j.simpleLogger.logFile=./logfiletxt
org.slf4j.simpleLogger.showLogName=false

      

When I change the logfile property as an option (-D), it works, that is, it logs to my log file and not the console (as seen below).

I have a very simple project setup and I have placed the file in the project root, which I understand is the default class. See attached photos.

File in folder The file in the folder

Classpath The classpath

Execution results show that it is not working Runtime results shows it's not working

+3


source to share


1 answer


You can put simplelogger.properties in src of your project



enter image description here

-1


source







All Articles