
org.jolokia.jvmagent.spring.log.Sl4jLogHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jolokia-support-spring Show documentation
Show all versions of jolokia-support-spring Show documentation
Jolokia :: Support :: Spring JVM Agent
package org.jolokia.jvmagent.spring.log;
import org.jolokia.server.core.service.api.LogHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Loghandler using SL4J
*
* @author roland
* @since 21.10.13
*/
public class Sl4jLogHandler implements LogHandler {
private Logger logger;
/**
* Constructor for a {@link LogHandler} using commons SL4J
*
* @param pCategory the logging category. If null, org.jolokia is used as category
*/
public Sl4jLogHandler(String pCategory) {
logger = LoggerFactory.getLogger(pCategory != null ? pCategory : "org.jolokia");
}
/** {@inheritDoc} */
public void debug(String message) {
logger.debug(message);
}
/** {@inheritDoc} */
public void info(String message) {
logger.info(message);
}
/** {@inheritDoc} */
public void error(String message, Throwable t) {
logger.error(message,t);
}
/** {@inheritDoc} */
public boolean isDebug() {
return logger.isDebugEnabled();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy