@Override public void fatal(String format, Object... args) { logger.fatal(format, args); }
@Override public void fatal(String msg) { logger.fatal(msg); }
void logWaitOnOperationsSevere(Logger alertLogger, long severeAlertMS) { // OSProcess.printStacks(0); alertLogger.fatal("This thread has been stalled for {} milliseconds " + "waiting for current operations to complete. Something may be blocking operations.", severeAlertMS); }
@Override public void fatal(String msg, Throwable throwable) { logger.fatal(msg, throwable); }
public JCAConnectionManagerImpl(ManagedConnectionFactory mcf, ConfiguredDataSourceProperties configs) { // Get the security info and form the Subject // Initialize the Pool. try { isActive = true; mannPoolCache = new ManagedPoolCacheImpl(mcf, null, null, this, configs); } catch (Exception ex) { logger.fatal(String.format( "JCAConnectionManagerImpl::Constructor: An exception was caught while initialising due to %s", ex.getLocalizedMessage()), ex); } }
protected synchronized void fileDescriptorsExhausted() { if (!ulimitWarningIssued) { ulimitWarningIssued = true; logger.fatal( "This process is out of file descriptors.This will hamper communications and slow down the system.Any conserve-sockets setting is now being ignored.Please consider raising the descriptor limit.This alert is only issued once per process."); InternalDistributedSystem.getAnyInstance().setShareSockets(true); threadWantsOwnResources = new ThreadLocal(); } }
private ClientUpdateMessageImpl constructClientMessage(InternalCacheEvent event) { ClientUpdateMessageImpl clientMessage = null; EnumListenerEvent operation = event.getEventType(); try { clientMessage = initializeMessage(operation, event); } catch (Exception e) { logger.fatal(String.format( "CacheClientNotifier: Cannot notify clients to perform operation %s on event %s", new Object[] {operation, event}), e); } return clientMessage; }
protected synchronized void processException(ReplyException ex) { if (this.exception == null) { // only keep first exception this.exception = ex; } else if (logMultipleExceptions()) { if (!(ex.getCause() instanceof ConcurrentCacheModificationException)) { logger.fatal( "Exception received in ReplyMessage. Only one exception is passed back to caller. This exception is logged only.", ex); } } }
public static void main(final String[] args) { try (final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), "target/test-classes/log4j2-console-highlight-logback.xml")) { LOG.fatal("Fatal message."); LOG.error("Error message."); LOG.warn("Warning message."); LOG.info("Information message."); LOG.debug("Debug message."); LOG.trace("Trace message."); LOG.error("Error message.", new IOException("test")); } }
public static void main(final String[] args) { System.setProperty("log4j.skipJansi", "false"); // LOG4J2-2087: explicitly enable try (final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), "target/test-classes/log4j2-console-highlight-default.xml")) { LOG.fatal("Fatal message."); LOG.error("Error message."); LOG.warn("Warning message."); LOG.info("Information message."); LOG.debug("Debug message."); LOG.trace("Trace message."); LOG.error("Error message.", new IOException("test")); } }
public static void main(final String[] args) { System.setProperty("log4j.skipJansi", "false"); // LOG4J2-2087: explicitly enable try (final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), "target/test-classes/log4j2-console.xml")) { LOG.fatal("\u001b[1;35mFatal message.\u001b[0m"); LOG.error("\u001b[1;31mError message.\u001b[0m"); LOG.warn("\u001b[0;33mWarning message.\u001b[0m"); LOG.info("\u001b[0;32mInformation message.\u001b[0m"); LOG.debug("\u001b[0;36mDebug message.\u001b[0m"); LOG.trace("\u001b[0;30mTrace message.\u001b[0m"); LOG.error("\u001b[1;31mError message.\u001b[0m", new IOException("test")); } }
public static void main(final String[] args) { System.setProperty("log4j.skipJansi", "false"); // LOG4J2-2087: explicitly enable try (final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), "target/test-classes/log4j2-console-style-name-ansi.xml")) { LOG.fatal("Fatal message."); LOG.error("Error message."); LOG.warn("Warning message."); LOG.info("Information message."); LOG.debug("Debug message."); LOG.trace("Trace message."); LOG.error("Error message.", new IOException("test")); } }
public static void main(final String[] args) { System.setProperty("log4j.skipJansi", "false"); // LOG4J2-2087: explicitly enable try (final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), "target/test-classes/log4j2-console-highlight.xml")) { LOG.fatal("Fatal message."); LOG.error("Error message."); LOG.warn("Warning message."); LOG.info("Information message."); LOG.debug("Debug message."); LOG.trace("Trace message."); LOG.error("Error message.", new IOException("test")); } }
/** * Notes that an error has occurred in the agent and that it has shut down because of it. */ private void setServerError(final String message, final Throwable cause) { try { writeStatus(createStatus(this.basename, SHUTDOWN_PENDING_AFTER_FAILED_STARTUP, OSProcess.getId(), message, cause)); } catch (Exception e) { logger.fatal(e.getMessage(), e); ExitCode.FATAL.doSystemExit(); } }
@Override void processLocally() { try { addToResults(member, finishBackupFactory.createFinishBackup(cache).run()); } catch (IOException e) { logger.fatal("Failed to FinishBackup in " + member, e); } } }
public void test(final String[] args) { System.setProperty("log4j.skipJansi", "false"); // LOG4J2-2087: explicitly enable // System.out.println(System.getProperty("java.class.path")); final String config = args == null || args.length == 0 ? "target/test-classes/log4j2-console-style-ansi.xml" : args[0]; try (final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), config)) { final Logger logger = LogManager.getLogger(ConsoleAppenderAnsiStyleLayoutMain.class); logger.fatal("Fatal message."); logger.error("Error message."); logger.warn("Warning message."); logger.info("Information message."); logger.debug("Debug message."); logger.trace("Trace message."); logger.error("Error message.", new IOException("test")); } }
@Override void processLocally() { try { addToResults(member, prepareBackupFactory.createPrepareBackup(member, cache, properties).run()); } catch (IOException | InterruptedException e) { logger.fatal("Failed to PrepareBackup in " + member, e); } } }
@Test public void verifyFatalMessageLoggedWhenUncaughtExceptionIsCalled() { Logger logger = mock(Logger.class); Thread thread = mock(Thread.class); Throwable throwable = mock(Throwable.class); Implementation handler = new Implementation(logger, null); handler.uncaughtException(thread, throwable); verify(logger).fatal("Uncaught exception in thread " + thread, throwable); }
@Override public void cmdExecute(final Message clientMessage, final ServerConnection serverConnection, final SecurityService securityService, long start) throws IOException { // requiresResponse = true; NOT NEEDED... ALWAYS SEND ERROR RESPONSE logger.fatal("{}: Unknown message type ({}) with tx: {} from {}", new Object[] {serverConnection.getName(), MessageType.getString(clientMessage.getMessageType()), Integer.valueOf(clientMessage.getTransactionId()), serverConnection.getSocketString()}); writeErrorResponse(clientMessage, MessageType.UNKNOWN_MESSAGE_TYPE_ERROR, serverConnection); // responded = true; NOT NEEDED... ALWAYS SEND ERROR RESPONSE }
@Test public void testMethodLogger() throws Exception { final ListAppender app = context.getListAppender("Method").clear(); final Logger logger = context.getLogger("MethodLogger"); logger.info("More messages."); logger.warn("CATASTROPHE INCOMING!"); logger.error("ZOMBIES!!!"); logger.fatal("brains~~~"); logger.info("Itchy. Tasty."); final List<String> messages = app.getMessages(); assertEquals("Incorrect number of messages.", 5, messages.size()); for (final String message : messages) { assertEquals("Incorrect caller method name.", "testMethodLogger", message); } } }