diff --git a/pom.xml b/pom.xml index 2614c9f..9735c7e 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,16 @@ junit-addons 1.4 + + org.apache.logging.log4j + log4j-api + 2.8.1 + + + org.apache.logging.log4j + log4j-core + 2.8.1 + diff --git a/src/main/java/ru/spbau/mit/Main.java b/src/main/java/ru/spbau/mit/Main.java new file mode 100644 index 0000000..ec7d457 --- /dev/null +++ b/src/main/java/ru/spbau/mit/Main.java @@ -0,0 +1,17 @@ +package ru.spbau.mit; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * Created by bronti on 20.03.17. + */ +public class Main { + private static final Logger LOG = LogManager.getLogger(); + + public static void main(String[] args) { + LOG.debug("This should not show up anywhere."); + LOG.info("This should show up in the file."); + LOG.error("This should show up both in the file and in the console."); + } +} diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml new file mode 100644 index 0000000..3edb8f0 --- /dev/null +++ b/src/main/resources/log4j2.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file