[Minor] Removed dependency to ch.eitchnet.log4j and thus added log4j.xml
The log4j.xml configuration file is in the test resources and now the project is completely free of a dependency to a concrete logging implementation as all logging of the sources is done over slf4j
This commit is contained in:
parent
38466685a0
commit
e5c23a8924
6
pom.xml
6
pom.xml
|
@ -122,12 +122,6 @@
|
|||
<artifactId>ch.eitchnet.utils</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.eitchnet</groupId>
|
||||
<artifactId>ch.eitchnet.log4j</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
log4j.rootLogger = info, stdout
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %5p [%t] %C{1} %M - %m%n
|
||||
|
||||
#log4j.appender.file=org.apache.log4j.RollingFileAppender
|
||||
#log4j.appender.file.File=${user.dir}/logs/app.log
|
||||
#log4j.appender.file.MaxFileSize=10000KB
|
||||
#log4j.appender.file.MaxBackupIndex=0
|
||||
#log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||
#log4j.appender.file.layout.ConversionPattern=%d %5p [%t] %C{1} %M - %m%n
|
|
@ -23,13 +23,12 @@ import java.io.File;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ch.eitchnet.utils.helper.Log4jConfigurator;
|
||||
import ch.eitchnet.utils.objectfilter.ITransactionObject;
|
||||
import ch.eitchnet.xmlpers.XmlPersistenceExecption;
|
||||
import ch.eitchnet.xmlpers.XmlPersistenceHandler;
|
||||
|
@ -53,11 +52,7 @@ public class XmlPersistenceTest {
|
|||
*/
|
||||
@BeforeClass
|
||||
public static void init() throws Exception {
|
||||
|
||||
try {
|
||||
// set up log4j
|
||||
Log4jConfigurator.configure();
|
||||
|
||||
String userDir = System.getProperty("user.dir");
|
||||
String basePath = userDir + "/tmp/testdb";
|
||||
File basePathF = new File(basePath);
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
|
||||
<log4j:configuration debug="false" xmlns:log4j='http://jakarta.apache.org/log4j/'>
|
||||
|
||||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d %5p [%t] %C{1} %M - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
<appender name="FILE" class="org.apache.log4j.FileAppender">
|
||||
<param name="File" value="sample.log"/>
|
||||
<param name="BufferedIO" value="true" />
|
||||
<param name="Append" value="true" />
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d %5p [%t] %C{1} %M - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<logger name="ch.eitchnet">
|
||||
<level value="info" />
|
||||
</logger>
|
||||
|
||||
<root>
|
||||
<priority value="info" />
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<!-- appender-ref ref="FILE" / -->
|
||||
</root>
|
||||
|
||||
</log4j:configuration>
|
Loading…
Reference in New Issue