當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。