Skip to content

Commit

Permalink
some missed changes to log4j2
Browse files Browse the repository at this point in the history
  • Loading branch information
anneferger committed Aug 19, 2022
1 parent bf41ddb commit b3b8456
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@
<version>2.18.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.18.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.18.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/pl/psnc/dl/ege/EGEImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,18 @@ public class EGEImpl
try {
String pathToProps = EGEConstants.OXGAPP + "log4j.xml";
File conf = new File(pathToProps);
LOGGER.debug("now trying to configure the logger");
if (conf.exists()) {
LOGGER.debug("logger conf exists at " + pathToProps);
Configurator.setRootLevel(Level.DEBUG);
ConfigurationFactory.setConfigurationFactory(new XmlConfigurationFactory());
Configurator.reconfigure(new URI("pathToProps"));
Configurator.reconfigure(new URI(pathToProps));

}
else {
Configurator.initialize(new DefaultConfiguration());
Configurator.setRootLevel(Level.ERROR);
LOGGER.error("logger conf does not exist");
}
}
catch (Exception e1) {
Expand Down

0 comments on commit b3b8456

Please sign in to comment.