2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jcoreeelogger.beans.local.logger;
19 import javax.ejb.Singleton;
20 import javax.ejb.Startup;
21 import javax.inject.Inject;
22 import org.apache.logging.log4j.Logger;
25 * A "centralized" logger bean
27 * @author Roland Haeder<roland@mxchange.org>
30 @Singleton (name = "logger", description = "A centralized logger bean")
31 public class LoggerBean implements LoggerBeanLocal {
38 private Logger logger;
43 public LoggerBean () {
47 public void logDebug (final String message) {
49 this.getLogger().debug(message);
53 public void logDebug (final String message, final Throwable cause) {
55 this.getLogger().debug(message, cause);
59 public void logException (final Throwable throwable) {
61 this.getLogger().catching(throwable);
65 public void logFatal (final String message, final Throwable cause) {
67 this.getLogger().fatal(message, cause);
71 public void logFatal (final String message) {
73 this.getLogger().fatal(message);
77 public void logInfo (final String message) {
79 this.getLogger().info(message);
83 public void logInfo (final String message, final Throwable cause) {
85 this.getLogger().info(message, cause);
89 public void logTrace (final String message) {
91 this.getLogger().trace(message);
95 public void logTrace (final String message, final Throwable cause) {
97 this.getLogger().trace(message, cause);
101 public void logWarning (final String message) {
102 // Deligate to logger
103 this.getLogger().warn(message);
107 public void logWarning (final String message, final Throwable cause) {
108 // Deligate to logger
109 this.getLogger().warn(message, cause);
117 private Logger getLogger () {