ml-in-programming / ArchitectureReloaded

Design defects detection plugin for IntelliJ IDEA. Based on BasLeijdekkers/MetricsReloaded plugin.
Other
8 stars 3 forks source link

Log4J is configured in Java code #63

Open Ivan-Veselov opened 6 years ago

Ivan-Veselov commented 6 years ago

Currently Log4J logs are configured in Java code. Simple addition of Log4J property file to resources folder failed for no apparent reason. Seems like Log4J just can't see configuration file.

RamSaw commented 6 years ago

Investigation: if we run code without plugin from default main method then logger works correctly. It doesn't have (getAllAppenders) any appender but prints to console anyway. If we run this main method in plugin execution (runIde task) then no output in console and logger has no appenders too. Adding appender solves the problem. Also log4j.properties is in classpath so problem must be in plugin execution. Set property doesn't help too: System.setProperty("log4j.configuration", Objects.requireNonNull(Logging.class.getClassLoader().getResource("log4j.properties")).getFile());