]> git.mxchange.org Git - jcore-logger-ejb.git/blobdiff - src/java/org/mxchange/jcoreeelogger/beans/local/logger/LoggerBean.java
Changed copyright notice to the FSF, so after my death they will continue my
[jcore-logger-ejb.git] / src / java / org / mxchange / jcoreeelogger / beans / local / logger / LoggerBean.java
index b1f0538958082c246b46fe0b4ed0dc9998882fd1..66a3638a903dc18e24a0c2b50bed8a25d972d727 100644 (file)
@@ -1,17 +1,17 @@
 /*
- * Copyright (C) 2015 Roland Haeder
+ * Copyright (C) 2016, 2017 Free Software Foundation
  *
  * 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.
+ * it under the terms of the GNU Affero 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.
+ * GNU Affero General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
+ * You should have received a copy of the GNU Affero General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 package org.mxchange.jcoreeelogger.beans.local.logger;
@@ -20,17 +20,21 @@ 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
- *
- * @author Roland Haeder
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
  */
 @Startup
-@Singleton(name = "logger", mappedName = "logger")
+@Singleton (name = "logger", description = "A centralized logger bean")
 public class LoggerBean implements LoggerBeanLocal {
 
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 186_978_639_741_260L;
+
        /**
         * Logger instance
         */
@@ -38,6 +42,12 @@ public class LoggerBean implements LoggerBeanLocal {
        @Log
        private Logger logger;
 
+       /**
+        * Default constructor
+        */
+       public LoggerBean () {
+       }
+
        @Override
        public void logDebug (final String message) {
                // Deligate to logger
@@ -50,6 +60,18 @@ public class LoggerBean implements LoggerBeanLocal {
                this.getLogger().debug(message, cause);
        }
 
+       @Override
+       public void logError (final String message) {
+               // Deligate to logger
+               this.getLogger().error(message);
+       }
+
+       @Override
+       public void logError (final String message, final Throwable cause) {
+               // Deligate to logger
+               this.getLogger().error(message, cause);
+       }
+
        @Override
        public void logException (final Throwable throwable) {
                // Deligate to logger
@@ -63,15 +85,15 @@ public class LoggerBean implements LoggerBeanLocal {
        }
 
        @Override
-       public void logInfo (final String message) {
+       public void logFatal (final String message) {
                // Deligate to logger
-               this.getLogger().info(message);
+               this.getLogger().fatal(message);
        }
 
        @Override
-       public void logFatal (final String message) {
+       public void logInfo (final String message) {
                // Deligate to logger
-               this.getLogger().fatal(message);
+               this.getLogger().info(message);
        }
 
        @Override
@@ -106,9 +128,11 @@ public class LoggerBean implements LoggerBeanLocal {
 
        /**
         * Getter for logger
+        * <p>
         * @return Logger
         */
        private Logger getLogger () {
                return this.logger;
        }
+
 }