Java Code Examples for org.apache.commons.logging.Log#fatal()

The following examples show how to use org.apache.commons.logging.Log#fatal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DeferredLog.java    From java-cfenv with Apache License 2.0 6 votes vote down vote up
private static void logTo(Log log, LogLevel level, Object message,
						  Throwable throwable) {
	switch (level) {
		case TRACE:
			log.trace(message, throwable);
			return;
		case DEBUG:
			log.debug(message, throwable);
			return;
		case INFO:
			log.info(message, throwable);
			return;
		case WARN:
			log.warn(message, throwable);
			return;
		case ERROR:
			log.error(message, throwable);
			return;
		case FATAL:
			log.fatal(message, throwable);
			return;
	}
}
 
Example 2
Source File: Log4jConfigurerTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
private void doTestInitLogging(String location, boolean refreshInterval) throws FileNotFoundException {
	if (refreshInterval) {
		Log4jConfigurer.initLogging(location, 10);
	}
	else {
		Log4jConfigurer.initLogging(location);
	}

	Log log = LogFactory.getLog(this.getClass());
	log.debug("debug");
	log.info("info");
	log.warn("warn");
	log.error("error");
	log.fatal("fatal");

	assertTrue(MockLog4jAppender.loggingStrings.contains("debug"));
	assertTrue(MockLog4jAppender.loggingStrings.contains("info"));
	assertTrue(MockLog4jAppender.loggingStrings.contains("warn"));
	assertTrue(MockLog4jAppender.loggingStrings.contains("error"));
	assertTrue(MockLog4jAppender.loggingStrings.contains("fatal"));

	Log4jConfigurer.shutdownLogging();
	assertTrue(MockLog4jAppender.closeCalled);
}
 
Example 3
Source File: Log4jWebConfigurerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
private void assertLogOutput() {
	Log log = LogFactory.getLog(this.getClass());
	log.debug("debug");
	log.info("info");
	log.warn("warn");
	log.error("error");
	log.fatal("fatal");

	assertTrue(MockLog4jAppender.loggingStrings.contains("debug"));
	assertTrue(MockLog4jAppender.loggingStrings.contains("info"));
	assertTrue(MockLog4jAppender.loggingStrings.contains("warn"));
	assertTrue(MockLog4jAppender.loggingStrings.contains("error"));
	assertTrue(MockLog4jAppender.loggingStrings.contains("fatal"));
}
 
Example 4
Source File: VfsLog.java    From commons-vfs with Apache License 2.0 5 votes vote down vote up
/**
 * fatal.
 *
 * @param vfsLog The base component Logger to use.
 * @param commonsLog The class specific Logger
 * @param message The message to log.
 */
public static void fatal(final Log vfsLog, final Log commonsLog, final String message) {
    if (vfsLog != null) {
        vfsLog.fatal(message);
    } else if (commonsLog != null) {
        commonsLog.fatal(message);
    }
}
 
Example 5
Source File: PhysicalExec.java    From tajo with Apache License 2.0 4 votes vote down vote up
protected void fatal(Log log, String message) {
  log.fatal("[" + context.getTaskId() + "] " + message);
}
 
Example 6
Source File: PhysicalExec.java    From incubator-tajo with Apache License 2.0 4 votes vote down vote up
protected void fatal(Log log, String message) {
  log.fatal("[" + context.getTaskId() + "] " + message);
}
 
Example 7
Source File: LogUtils.java    From alfresco-bulk-import with Apache License 2.0 4 votes vote down vote up
public final static void fatal(final Log log, final String message)
{
    log.fatal(PREFIX + message);
}
 
Example 8
Source File: LogUtils.java    From alfresco-bulk-import with Apache License 2.0 4 votes vote down vote up
public final static void fatal(final Log log, final String message, final Throwable cause)
{
    log.fatal(PREFIX + message, cause);
}
 
Example 9
Source File: LogUtils.java    From alfresco-bulk-import with Apache License 2.0 4 votes vote down vote up
public final static void fatal(final Log log, final Throwable cause)
{
    log.fatal(RAW_EXCEPTION, cause);
}
 
Example 10
Source File: VfsLog.java    From commons-vfs with Apache License 2.0 3 votes vote down vote up
/**
 * fatal.
 *
 * @param vfsLog The base component Logger to use.
 * @param commonsLog The class specific Logger
 * @param message The message to log.
 * @param t The exception, if any.
 */
public static void fatal(final Log vfsLog, final Log commonsLog, final String message, final Throwable t) {
    if (vfsLog != null) {
        vfsLog.fatal(message, t);
    } else if (commonsLog != null) {
        commonsLog.fatal(message, t);
    }
}