1 28 29 package org.apache.commons.transaction.util; 30 31 import org.apache.log4j.Logger; 32 33 38 public class Log4jLogger implements LoggerFacade { 39 40 protected Logger logger; 41 42 public Log4jLogger(Logger logger) { 43 this.logger = logger; 44 } 45 46 public Logger getLogger() { 47 return logger; 48 } 49 50 public LoggerFacade createLogger(String name) { 51 return new Log4jLogger(Logger.getLogger(name)); 52 } 53 54 public void logInfo(String message) { 55 logger.info(message); 56 } 57 58 public void logFine(String message) { 59 logger.debug(message); 60 } 61 62 public boolean isFineEnabled() { 63 return logger.isDebugEnabled(); 64 } 65 66 public void logFiner(String message) { 67 logger.debug(message); 68 } 69 70 public boolean isFinerEnabled() { 71 return logger.isDebugEnabled(); 72 } 73 74 public void logFinest(String message) { 75 logger.debug(message); 76 } 77 78 public boolean isFinestEnabled() { 79 return logger.isDebugEnabled(); 80 } 81 82 public void logWarning(String message) { 83 logger.warn(message); 84 } 85 86 public void logWarning(String message, Throwable t) { 87 logger.warn(message, t); 88 } 89 public void logSevere(String message) { 90 logger.error(message); 91 } 92 93 public void logSevere(String message, Throwable t) { 94 logger.error(message, t); 95 } 96 } 97 | Popular Tags |