[Lada-commits] [PATCH 08 of 13] Updated logging infrastructure. Using log4j 1.2.17 since log4j2 does not with arquillian

Wald Commits scm-commit at wald.intevation.org
Fri Feb 6 17:57:42 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1423234708 -3600
# Node ID 5011173fd340abe2b3b7b92b0cac9c14dc0b08f2
# Parent  8157dd28aba79546108d3cc73ab2d9626caabb1b
Updated logging infrastructure. Using log4j 1.2.17 since log4j2 does not with arquillian.

diff -r 8157dd28aba7 -r 5011173fd340 pom.xml
--- a/pom.xml	Fri Feb 06 13:35:47 2015 +0100
+++ b/pom.xml	Fri Feb 06 15:58:28 2015 +0100
@@ -46,11 +46,11 @@
             <artifactId>cdi-api</artifactId>
             <scope>provided</scope>
         </dependency>
-        <!-- dependency>
+        <dependency>
             <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-            <version>1.1.1</version>
-        </dependency-->
+            <artifactId>javax.ws.rs-api</artifactId>
+            <version>2.0.1</version>
+        </dependency>
         <dependency>
             <groupId>org.jboss.spec.javax.ejb</groupId>
             <artifactId>jboss-ejb-api_3.2_spec</artifactId>
@@ -100,24 +100,9 @@
 
         <!-- Logging -->
         <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-core</artifactId>
-            <version>2.1</version>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-core</artifactId>
-            <version>2.4.2</version>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-            <version>2.4.2</version>
-        </dependency> 
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-annotations</artifactId>
-            <version>2.4.2</version>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.17</version>
         </dependency>
 
         <!-- Arquillian/Testing -->
@@ -185,7 +170,7 @@
             <dependencies>
                 <dependency>
                     <groupId>org.wildfly</groupId>
-                    <artifactId>wildfly-arquillian-container-remote</artifactId>
+                    <artifactId>wildfly-arquillian-container-managed</artifactId>
                     <version>8.2.0.Final</version>
                     <scope>test</scope>
                 </dependency>
diff -r 8157dd28aba7 -r 5011173fd340 src/main/java/de/intevation/lada/util/factory/LoggerFactory.java
--- a/src/main/java/de/intevation/lada/util/factory/LoggerFactory.java	Fri Feb 06 13:35:47 2015 +0100
+++ b/src/main/java/de/intevation/lada/util/factory/LoggerFactory.java	Fri Feb 06 15:58:28 2015 +0100
@@ -11,8 +11,7 @@
 import javax.enterprise.inject.Produces;
 import javax.enterprise.inject.spi.InjectionPoint;
 
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+import org.apache.log4j.Logger;
 
 
 @ApplicationScoped
@@ -20,7 +19,7 @@
 
     @Produces
     Logger createLogger(InjectionPoint injectionPoint) {
-        return LogManager.getLogger(
+        return Logger.getLogger(
             injectionPoint.getMember().getDeclaringClass().getName());
     }
 }
diff -r 8157dd28aba7 -r 5011173fd340 src/main/resources/META-INF/persistence.xml
--- a/src/main/resources/META-INF/persistence.xml	Fri Feb 06 13:35:47 2015 +0100
+++ b/src/main/resources/META-INF/persistence.xml	Fri Feb 06 15:58:28 2015 +0100
@@ -9,7 +9,7 @@
         <properties>
             <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/bund"/>
             <!-- Properties for Hibernate -->
-            <property name="hibernate.show_sql" value="true" />
+            <property name="hibernate.show_sql" value="false" />
             <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
             <property name="hibernate.hbm2ddl.auto" value="none"/>
             <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /> 
@@ -21,7 +21,7 @@
        	<exclude-unlisted-classes>false</exclude-unlisted-classes>
     	<properties>
             <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/land"/>
-            <property name="hibernate.show_sql" value="true" />
+            <property name="hibernate.show_sql" value="false" />
             <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
             <property name="hibernate.hbm2ddl.auto" value="none"/>
        </properties>
@@ -31,7 +31,7 @@
         <jta-data-source>java:/jboss/lada-stamm</jta-data-source>
         <properties>
             <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/stamm"/>
-            <property name="hibernate.show_sql" value="true" />
+            <property name="hibernate.show_sql" value="false" />
             <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
             <property name="hibernate.hbm2ddl.auto" value="none"/>
         </properties>
diff -r 8157dd28aba7 -r 5011173fd340 src/main/webapp/WEB-INF/classes/log4j.properties
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/webapp/WEB-INF/classes/log4j.properties	Fri Feb 06 15:58:28 2015 +0100
@@ -0,0 +1,8 @@
+log4j.rootLogger=DEBUG, lada
+log4j.logger.org.hibernate=ERROR
+log4j.appender.lada=org.apache.log4j.RollingFileAppender
+log4j.appender.lada.File=../log/lada-server.log
+log4j.appender.lada.MaxFileSize=1MB
+log4j.appender.lada.MaxBackupIndex=5
+log4j.appender.lada.layout=org.apache.log4j.PatternLayout
+log4j.appender.lada.layout.ConversionPattern=%d %p %l: %m%n
diff -r 8157dd28aba7 -r 5011173fd340 src/main/webapp/WEB-INF/classes/log4j2.json
--- a/src/main/webapp/WEB-INF/classes/log4j2.json	Fri Feb 06 13:35:47 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-{
-    "configuration": {
-        "status": "error",
-        "name": "LadaLogger",
-        "properties": {
-            "property": [{
-                "name": "filename",
-                "value": "lada-test.log"
-            }, {
-                "name": "directory",
-                "value": "../log"
-            }]
-        },
-        "appenders": {
-            "RollingFile": {
-                "name": "File",
-                "fileName": "${directory}/${filename}",
-                "filePattern": "${directory}/${date:yyyy-MM}/test-%d{MM-dd-yyyy}-%i.log",
-                "patternLayout": {
-                    "pattern": "%d %p %logger: %m%n"
-                },
-                "policies": {
-                    "SizeBasedTriggeringPolicy": {
-                        "size": "2 MB"
-                    }
-                },
-                "DefaultRolloverStrategy": {
-                    "max": "10"
-                }
-            }
-        },
-        "loggers": {
-            "root": {
-                "level": "debug",
-                "appender-ref": {
-                    "ref": "File"
-                }
-            }
-        }
-    }
-}
diff -r 8157dd28aba7 -r 5011173fd340 src/test/java/de/intevation/lada/LadaTest.java
--- a/src/test/java/de/intevation/lada/LadaTest.java	Fri Feb 06 13:35:47 2015 +0100
+++ b/src/test/java/de/intevation/lada/LadaTest.java	Fri Feb 06 15:58:28 2015 +0100
@@ -29,6 +29,7 @@
         return ShrinkWrap.create(WebArchive.class, "lada-basis-test.war")
             .addPackages(true, Package.getPackage("de.intevation.lada"))
             .addClass(QueryServiceTest.class)
+            .addAsResource("log4j.properties", "log4j.properties")
             .addAsResource("queryconf.json", "queryconf.json")
             .addAsResource("META-INF/test-persistence.xml",
                 "META-INF/persistence.xml");
diff -r 8157dd28aba7 -r 5011173fd340 src/test/resources/META-INF/test-persistence.xml
--- a/src/test/resources/META-INF/test-persistence.xml	Fri Feb 06 13:35:47 2015 +0100
+++ b/src/test/resources/META-INF/test-persistence.xml	Fri Feb 06 15:58:28 2015 +0100
@@ -9,7 +9,7 @@
         <properties>
             <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/bund"/>
             <!-- Properties for Hibernate -->
-            <property name="hibernate.show_sql" value="true" />
+            <property name="hibernate.show_sql" value="false" />
             <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
             <property name="hibernate.hbm2ddl.auto" value="none"/>
             <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /> 
@@ -21,7 +21,7 @@
        	<exclude-unlisted-classes>false</exclude-unlisted-classes>
     	<properties>
             <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/land"/>
-            <property name="hibernate.show_sql" value="true" />
+            <property name="hibernate.show_sql" value="false" />
             <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
             <property name="hibernate.hbm2ddl.auto" value="none"/>
        </properties>
@@ -31,7 +31,7 @@
         <jta-data-source>java:/jboss/lada-stamm</jta-data-source>
         <properties>
             <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/stamm"/>
-            <property name="hibernate.show_sql" value="true" />
+            <property name="hibernate.show_sql" value="false" />
             <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
             <property name="hibernate.hbm2ddl.auto" value="none"/>
         </properties>
diff -r 8157dd28aba7 -r 5011173fd340 src/test/resources/log4j.properties
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/resources/log4j.properties	Fri Feb 06 15:58:28 2015 +0100
@@ -0,0 +1,8 @@
+log4j.rootLogger=DEBUG, lada
+log4j.logger.org.hibernate=ERROR
+log4j.appender.lada=org.apache.log4j.RollingFileAppender
+log4j.appender.lada.File=../log/lada-server.log
+log4j.appender.lada.MaxFileSize=1MB
+log4j.appender.lada.MaxBackupIndex=5
+log4j.appender.lada.layout=org.apache.log4j.PatternLayout
+log4j.appender.lada.layout.ConversionPattern=%d %p %l: %m%n


More information about the Lada-commits mailing list