当前位置: 首页>>代码示例>>Java>>正文


Java LogFactory类代码示例

本文整理汇总了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;

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:33,代码来源:Digester.java

示例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() + "]");
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:21,代码来源:LoggingBaseTest.java

示例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;

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:34,代码来源:Digester.java

示例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());
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:20,代码来源:LoggingBaseTest.java

示例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());
}
 
开发者ID:chanjarster,项目名称:tomcat-mongo-access-log,代码行数:20,代码来源:LoggingBaseTest.java

示例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;
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:26,代码来源:ParserUtils.java

示例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);

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:ContainerBase.java

示例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);
}
 
开发者ID:appNG,项目名称:appng-tomcat-session,代码行数:12,代码来源:Utils.java

示例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);

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:13,代码来源:ContainerBase.java

示例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;
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:25,代码来源:Digester.java

示例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
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:8,代码来源:ParserUtils.java

示例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);
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:7,代码来源:TomcatLog.java

示例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;
}
 
开发者ID:Sewatech,项目名称:swutils,代码行数:7,代码来源:LdapRealmTest.java


注:本文中的org.apache.juli.logging.LogFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。