Last active
May 19, 2016 12:52
-
-
Save claytantor/9d79215178a6689340e8 to your computer and use it in GitHub Desktop.
Configurations for log4j
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.claytantor.log4j.playground; | |
import org.apache.log4j.Logger; | |
/** | |
* Created by cgra12 on 8/24/15. | |
*/ | |
public class HelloLog4j { | |
static Logger log = Logger.getLogger(HelloLog4j.class.getName()); | |
public static void main(String[] args){ | |
log.debug("Hello log4j"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | |
<appender name="console" class="org.apache.log4j.ConsoleAppender"> | |
<param name="Target" value="System.out"/> | |
<layout class="org.apache.log4j.PatternLayout"> | |
<param name="ConversionPattern" value="%-5p %c{1} - %m%n"/> | |
</layout> | |
</appender> | |
<root> | |
<priority value ="debug" /> | |
<appender-ref ref="console" /> | |
</root> | |
</log4j:configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.claytantor.log4j</groupId> | |
<artifactId>log4j-playground</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<dependencies> | |
<!-- | |
old approach but verified | |
slf4j-api-1.6.1.jar | |
slf4j-log4j12-1.6.1.jar | |
log4j-1.2.16.jar | |
--> | |
<dependency> | |
<groupId>org.apache.logging.log4j</groupId> | |
<artifactId>log4j-core</artifactId> | |
<version>2.3</version> | |
</dependency> | |
<dependency> | |
<groupId>org.slf4j</groupId> | |
<artifactId>slf4j-log4j12</artifactId> | |
<version>1.7.12</version> | |
</dependency> | |
<dependency> | |
<groupId>org.slf4j</groupId> | |
<artifactId>slf4j-api</artifactId> | |
<version>1.7.12</version> | |
</dependency> | |
</dependencies> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment