]> git.mxchange.org Git - jcore-logger-ejb.git/commitdiff
Log and LoggerFactory must still reside in same package ... Well, the beans.xml did...
authorRoland Haeder <roland@mxchange.org>
Wed, 9 Sep 2015 08:17:20 +0000 (10:17 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 9 Sep 2015 08:17:20 +0000 (10:17 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jshop-ee-lib.jar
src/conf/beans.xml [new file with mode: 0644]
src/java/log4j2.xml [new file with mode: 0644]
src/java/org/mxchange/jcoreeelogger/Log.java [deleted file]
src/java/org/mxchange/jcoreeelogger/LoggerFactory.java [deleted file]
src/java/org/mxchange/jcoreeelogger/beans/local/logger/Log.java [new file with mode: 0644]
src/java/org/mxchange/jcoreeelogger/beans/local/logger/LoggerBean.java
src/java/org/mxchange/jcoreeelogger/beans/local/logger/LoggerFactory.java [new file with mode: 0644]

index e9ef1ea9b67272f3cc54aff9166ccaaa4ea99550..657fb7073717301d8fdc08ac57eb98bd8307e0a2 100644 (file)
Binary files a/lib/jshop-ee-lib.jar and b/lib/jshop-ee-lib.jar differ
diff --git a/src/conf/beans.xml b/src/conf/beans.xml
new file mode 100644 (file)
index 0000000..0f4e2aa
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
+          bean-discovery-mode="all">
+</beans>
diff --git a/src/java/log4j2.xml b/src/java/log4j2.xml
new file mode 100644 (file)
index 0000000..1ebbd9f
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (C) 2015 Roland Haeder
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+<Configuration status="INFO">
+       <Appenders>
+               <Console name="STDOUT" target="SYSTEM_OUT">
+                       <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
+               </Console>
+       </Appenders>
+       <Loggers>
+               <Root level="trace">
+                       <AppenderRef ref="STDOUT" level="TRACE"/>
+               </Root>
+       </Loggers>
+</Configuration>
diff --git a/src/java/org/mxchange/jcoreeelogger/Log.java b/src/java/org/mxchange/jcoreeelogger/Log.java
deleted file mode 100644 (file)
index 4f2a82c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2015 KLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcoreeelogger;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import javax.inject.Qualifier;
-
-/**
- * Logger annotation. This file has been taken from
- * http://memorynotfound.com/java-se-unit-testing-cdi-junit-jboss-weld-se/ and has been slightly modified to make
- * it compile
- *
- * @author Roland Haeder
- */
-@Qualifier
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE, })
-public @interface Log {
-}
diff --git a/src/java/org/mxchange/jcoreeelogger/LoggerFactory.java b/src/java/org/mxchange/jcoreeelogger/LoggerFactory.java
deleted file mode 100644 (file)
index b9858b3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2015 KLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcoreeelogger;
-
-import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.InjectionPoint;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-public class LoggerFactory {
-
-       /**
-        * Own logger
-        */
-       private final Logger logger;
-
-       /**
-        * Factory method
-        */
-       public LoggerFactory () {
-               this.logger = LogManager.getLogger(this.getClass().getName());
-       }
-
-       @Produces
-       @Log
-       public Logger getLogger (final InjectionPoint caller) {
-               return LogManager.getLogger(caller.getMember().getDeclaringClass().getName());
-       }
-}
diff --git a/src/java/org/mxchange/jcoreeelogger/beans/local/logger/Log.java b/src/java/org/mxchange/jcoreeelogger/beans/local/logger/Log.java
new file mode 100644 (file)
index 0000000..3aba73f
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2015 KLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcoreeelogger.beans.local.logger;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import javax.inject.Qualifier;
+
+/**
+ * Logger annotation. This file has been taken from
+ * http://memorynotfound.com/java-se-unit-testing-cdi-junit-jboss-weld-se/ and has been slightly modified to make
+ * it work.
+ *
+ * @author Roland Haeder
+ */
+@Qualifier
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
+public @interface Log {
+}
index b1f0538958082c246b46fe0b4ed0dc9998882fd1..a64cd8aacacc7e4a34a65851eaf7193c05b1dc61 100644 (file)
@@ -20,7 +20,6 @@ import javax.ejb.Singleton;
 import javax.ejb.Startup;
 import javax.inject.Inject;
 import org.apache.logging.log4j.Logger;
-import org.mxchange.jcoreeelogger.Log;
 
 /**
  * A "centralized" logger bean
@@ -38,6 +37,12 @@ public class LoggerBean implements LoggerBeanLocal {
        @Log
        private Logger logger;
 
+       /**
+        * Default constructor
+        */
+       public LoggerBean () {
+       }
+
        @Override
        public void logDebug (final String message) {
                // Deligate to logger
diff --git a/src/java/org/mxchange/jcoreeelogger/beans/local/logger/LoggerFactory.java b/src/java/org/mxchange/jcoreeelogger/beans/local/logger/LoggerFactory.java
new file mode 100644 (file)
index 0000000..0fec8f1
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcoreeelogger.beans.local.logger;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+/**
+ * A logger factory
+ *
+ * @author Roland Haeder
+ */
+public class LoggerFactory {
+
+       /**
+        * Own logger
+        */
+       private final Logger logger;
+
+       /**
+        * Factory method
+        */
+       public LoggerFactory () {
+               this.logger = LogManager.getLogger(this.getClass().getName());
+       }
+
+       @Produces
+       @Log
+       public Logger getLogger (final InjectionPoint caller) {
+               return LogManager.getLogger(caller.getMember().getDeclaringClass().getName());
+       }
+}