I am using Geotools (version 19.2) to fetch some features. To deactivate the Geotools logging (< SEVERE) I tried 2 things:
- As I understood the logging documentation (documentation page):
Logging.getLogger("org.geotools").setLevel(Level.SEVERE);
- Loading a custom logging.properties configuration
The configuration (logging.properties) looks like this:
# standard log level
.level = WARNING
handlers = java.util.logging.ConsoleHandler
## limit the messages that are printed on the console to >= WARNING!
java.util.logging.ConsoleHandler.level = WARNING
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.encoding = Cp850
# do not use logging files!
java.util.logging.FileHandler.level = OFF
## just output geotools logs with level SEVERE!
org.geotools.level = SEVERE
Then I am loading the configuration using this code:
LogManager.getLogManager().readConfiguration(MyMainClass.class.getClassLoader().getResourceAsStream("logging.properties"));
Using both approaches I get NO logging output if I run my program in Eclipse. If I run my program as a JAR-file I get the following unwanted logging output:
Nov. 08, 2018 9:48:13 VORM. org.geotools.jdbc.JDBCDataStore getAggregateExpression INFO: Visitor class org.geotools.feature.visitor.CountVisitor has no aggregate attribute.
The INFO log resides from private Expression getAggregateExpression(FeatureVisitor visitor)
in JDBCDataStore
(see GitHub)
Any ideas why the logging configuration does not work for the generated JAR?