JavaFX, like all of Java SE, does not use Log4J, but instead uses the Java logging system. Log4J configuration will not affect JavaFX’s logging.
You can use LogManager.getLogManager().updateConfiguration to read a properties file with the overriding logging configuration:
try (InputStream loggingProperties =
MyApplication.class.getResource("logging.properties")) {
LogManager.getLogManager().updateConfiguration(loggingProperties);
}
(Note that readConfiguration replaces the entire logging configuration, whereas updateConfiguration amends your customizations to the configuration.)
If you just want to change logging for JavaFX, you can do something like this instead:
private static final Logger javafxLogger = Logger.getLogger("javafx");
static {
javafxLogger.setLevel(Level.FINEST);
}
The Logger needs to be retained in a field, or it will be garbage collected (quickly) and the customization will be lost.
Regardless of which of the above approaches you use, setting the level of the Logger is not enough. Handlers also have their own levels, and they too are set to Level.INFO by default.
The easiest way to address this is to set all of the Handlers’ levels:
for (Handler handler : Logger.getLogger("").getHandlers()) {
handler.setLevel(Level.ALL);
}