/*
- * 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;
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
*/
@Log
private Logger logger;
+ /**
+ * Default constructor
+ */
+ public LoggerBean () {
+ }
+
@Override
public void logDebug (final String message) {
// Deligate to logger
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
}
@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
/**
* Getter for logger
+ * <p>
* @return Logger
*/
private Logger getLogger () {
return this.logger;
}
+
}