本文整理汇总了Java中org.apache.juli.logging.LogFactory类的典型用法代码示例。如果您正苦于以下问题:Java LogFactory类的具体用法?Java LogFactory怎么用?Java LogFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LogFactory类属于org.apache.juli.logging包,在下文中一共展示了LogFactory类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
/**
* <p>
* Provide a hook for lazy configuration of this <code>Digester</code>
* instance. The default implementation does nothing, but subclasses
* can override as needed.
* </p>
*
* <p>
* <strong>Note</strong> This method may be called more than once.
* Once only initialization code should be placed in {@link #initialize}
* or the code should take responsibility by checking and setting the
* {@link #configured} flag.
* </p>
*/
protected void configure() {
// Do not configure more than once
if (configured) {
return;
}
log = LogFactory.getLog("org.apache.tomcat.util.digester.Digester");
saxLog = LogFactory.getLog("org.apache.tomcat.util.digester.Digester.sax");
// Perform lazy configuration as needed
initialize(); // call hook method for subclasses that want to be initialized once only
// Nothing else required by default
// Set the configuration flag to avoid repeating
configured = true;
}
示例2: setUp
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
// Create catalina.base directory
tempDir = new File(System.getProperty("tomcat.test.temp", "output/tmp"));
if (!tempDir.mkdirs() && !tempDir.isDirectory()) {
fail("Unable to create temporary directory for test");
}
System.setProperty("catalina.base", tempDir.getAbsolutePath());
// Configure logging
System.setProperty("java.util.logging.manager",
"org.apache.juli.ClassLoaderLogManager");
System.setProperty("java.util.logging.config.file", new File(
getBuildDirectory(), "conf/logging.properties").toString());
// Get log instance after logging has been configured
log = LogFactory.getLog(getClass());
log.info("Starting test case [" + testName.getMethodName() + "]");
}
示例3: configure
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
/**
* <p>
* Provide a hook for lazy configuration of this <code>Digester</code>
* instance. The default implementation does nothing, but subclasses can
* override as needed.
* </p>
*
* <p>
* <strong>Note</strong> This method may be called more than once. Once only
* initialization code should be placed in {@link #initialize} or the code
* should take responsibility by checking and setting the
* {@link #configured} flag.
* </p>
*/
protected void configure() {
// Do not configure more than once
if (configured) {
return;
}
log = LogFactory.getLog("org.apache.tomcat.util.digester.Digester");
saxLog = LogFactory.getLog("org.apache.tomcat.util.digester.Digester.sax");
// Perform lazy configuration as needed
initialize(); // call hook method for subclasses that want to be
// initialized once only
// Nothing else required by default
// Set the configuration flag to avoid repeating
configured = true;
}
示例4: setUp
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
// Create catalina.base directory
tempDir = new File(System.getProperty("tomcat.test.temp", "output/tmp"));
if (!tempDir.mkdirs() && !tempDir.isDirectory()) {
fail("Unable to create temporary directory for test");
}
System.setProperty("catalina.base", tempDir.getAbsolutePath());
// Configure logging
System.setProperty("java.util.logging.manager",
"org.apache.juli.ClassLoaderLogManager");
System.setProperty("java.util.logging.config.file", new File(
getBuildDirectory(), "conf/logging.properties").toString());
// Get log instance after logging has been configured
log = LogFactory.getLog(getClass());
}
示例5: setUp
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
// Create catalina.base directory
tempDir = new File(System.getProperty("tomcat.test.temp", "src/test/java/output"));
if (!tempDir.mkdirs() && !tempDir.isDirectory()) {
fail("Unable to create temporary directory for test");
}
System.setProperty("catalina.base", tempDir.getAbsolutePath());
// Configure logging
System.setProperty("java.util.logging.manager",
"org.apache.juli.ClassLoaderLogManager");
System.setProperty("java.util.logging.config.file", new File(
getBuildDirectory(), "conf/logging.properties").toString());
// Get log instance after logging has been configured
log = LogFactory.getLog(getClass());
}
示例6: resolveEntity
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
@Override
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException {
for (int i = 0; i < Constants.CACHED_DTD_PUBLIC_IDS.size(); i++) {
String cachedDtdPublicId = Constants.CACHED_DTD_PUBLIC_IDS.get(i);
if (cachedDtdPublicId.equals(publicId)) {
String resourcePath =
Constants.CACHED_DTD_RESOURCE_PATHS.get(i);
InputStream input = this.getClass().getResourceAsStream(
resourcePath);
if (input == null) {
throw new SAXException(Localizer.getMessage(
"jsp.error.internal.filenotfound", resourcePath));
}
InputSource isrc = new InputSource(input);
return isrc;
}
}
Log log = LogFactory.getLog(MyEntityResolver.class);
if (log.isDebugEnabled())
log.debug("Resolve entity failed" + publicId + " " + systemId);
log.error(Localizer.getMessage("jsp.error.parse.xml.invalidPublicId",
publicId));
return null;
}
示例7: getLogger
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
/**
* Return the Logger for this Container.
*/
@Override
public Log getLogger() {
if (logger != null)
return (logger);
logger = LogFactory.getLog(logName());
return (logger);
}
示例8: getLog
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
public static Log getLog(Class<?> clazz) {
if (null != slf4jLoggerFactory) {
try {
Object slf4jLogger = slf4jLoggerFactory.getMethod("getLogger", Class.class).invoke(null, clazz);
return getSlf4jWrapper(clazz, slf4jLogger);
} catch (Exception e) {
LogFactory.getLog(Utils.class).error("error while retrieving slf4j logger", e);
}
}
return LogFactory.getLog(clazz);
}
示例9: getLogger
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
/**
* Return the Logger for this Container.
*/
@Override
public Log getLogger() {
if (logger != null)
return (logger);
logger = LogFactory.getLog(logName());
return (logger);
}
示例10: configure
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
/**
* <p>
* Provide a hook for lazy configuration of this <code>Digester</code>
* instance. The default implementation does nothing, but subclasses
* can override as needed.
* </p>
*
* <p>
* <strong>Note</strong> This method may be called more than once.
* </p>
*/
protected void configure() {
// Do not configure more than once
if (configured) {
return;
}
log = LogFactory.getLog("org.apache.tomcat.util.digester.Digester");
saxLog = LogFactory.getLog("org.apache.tomcat.util.digester.Digester.sax");
// Set the configuration flag to avoid repeating
configured = true;
}
示例11: warning
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
@Override
public void warning(SAXParseException ex) throws SAXException {
Log log = LogFactory.getLog(MyErrorHandler.class);
if (log.isDebugEnabled())
log.debug("ParserUtils: warning ", ex);
// We ignore warnings
}
示例12: TomcatLog
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
public TomcatLog(String name) {
super(name);
this.log = LogFactory.getLog(name);
Boolean debugcheck = Boolean.valueOf(CatalinaProperties.getProperty("com.creditease.monitor.debug"));
this.setDebugable(debugcheck);
}
示例13: prepareContainer
import org.apache.juli.logging.LogFactory; //导入依赖的package包/类
private Container prepareContainer() {
Container container = mock(Container.class);
when(container.getLogger())
.thenReturn(LogFactory.getLog("TEST"));
return container;
}