Refine search
public static void debugFrame(Logger logger, String message, ByteBuf byteIn) { if (logger.isTraceEnabled()) { int location = byteIn.readerIndex(); // debugging byte[] frame = new byte[byteIn.writerIndex()]; byteIn.readBytes(frame); try { logger.trace(message + "\n" + ByteUtil.formatGroup(ByteUtil.bytesToHex(frame), 8, 16)); } catch (Exception e) { logger.warn(e.getMessage(), e); } byteIn.readerIndex(location); } }
public static void inTransaction(SessionImplementor session, Consumer<SessionImplementor> action) { log.trace( "inTransaction(session,action)" ); log.trace( "Started transaction" ); log.trace( "Calling action in txn" ); action.accept( session ); log.trace( "Called action - in txn" ); log.warn( ACTION_COMPLETED_TXN, e );
@Override public void log(String fqcn, Level level, Throwable t, String format, Object... arguments) { switch (level) { case TRACE: logger.trace(fqcn, StrUtil.format(format, arguments), t); break; case DEBUG: logger.debug(fqcn, StrUtil.format(format, arguments), t); break; case INFO: logger.info(fqcn, StrUtil.format(format, arguments), t); break; case WARN: logger.warn(fqcn, StrUtil.format(format, arguments), t); break; case ERROR: logger.error(fqcn, StrUtil.format(format, arguments), t); break; default: throw new Error(StrUtil.format("Can not identify level: {}", level)); } } }
log.debug("Added url: "+url+", to ucl: "+this); log.warn("Failed to strip query from: "+url, e); clearBlacklists(); else if( log.isTraceEnabled() ) log.trace("Ignoring duplicate url: "+url+", for ucl: "+this);
@Override public boolean acquireLock() { if (hasChangeLogLock) { // We already have a lock return true; } Executor executor = ExecutorService.getInstance().getExecutor(database); try { database.rollback(); // Ensure table created and lock record inserted this.init(); } catch (DatabaseException de) { throw new IllegalStateException("Failed to retrieve lock", de); } try { log.debug("Trying to lock database"); executor.execute(new LockDatabaseChangeLogStatement()); log.debug("Successfully acquired database lock"); hasChangeLogLock = true; database.setCanCacheLiquibaseTableInfo(true); return true; } catch (DatabaseException de) { log.warn("Lock didn't yet acquired. Will possibly retry to acquire lock. Details: " + de.getMessage()); if (log.isTraceEnabled()) { log.debug(de.getMessage(), de); } return false; } }
public void run() { boolean trace = log.isTraceEnabled(); try { if( trace ) log.trace("Begin run, wrapper="+this); runThread = Thread.currentThread(); started = true; runnable.run(); runThread = null; if( trace ) log.trace("End run, wrapper="+this); } catch (Throwable t) { log.warn("Unhandled throwable for runnable: " + runnable, t); } } }
protected void jbossInternalDestroy() { if (state != STOPPED) { destroyIgnored = true; if (log.isDebugEnabled()) { log.debug("Ignoring destroy call; current state is " + getStateString()); } return; } destroyIgnored = false; if (log.isDebugEnabled()) { log.debug("Destroying " + jbossInternalDescription()); } try { destroyService(); } catch (Throwable t) { log.warn(ServiceMBeanLogger.ROOT_LOGGER.destroyingFailed(jbossInternalDescription()), t); } state = DESTROYED; if (log.isDebugEnabled()) { log.debug("Destroyed " + jbossInternalDescription()); } if (unregisterIgnored) { postDeregister(); } }
@Override public void log(String fqcn, Level level, Throwable t, String format, Object... arguments) { switch (level) { case TRACE: logger.trace(fqcn, StrUtil.format(format, arguments), t); break; case DEBUG: logger.debug(fqcn, StrUtil.format(format, arguments), t); break; case INFO: logger.info(fqcn, StrUtil.format(format, arguments), t); break; case WARN: logger.warn(fqcn, StrUtil.format(format, arguments), t); break; case ERROR: logger.error(fqcn, StrUtil.format(format, arguments), t); break; default: throw new Error(StrUtil.format("Can not identify level: {}", level)); } } }
public void onException(JMSException exception) { if (isDestroyed) { if (log.isTraceEnabled()) log.trace("Ignoring error on already destroyed connection " + this, exception); return; } log.warn("Handling jms exception failure: " + this, exception); try { con.setExceptionListener(null); } catch (JMSException e) { log.debug("Unable to unset exception listener", e); } ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception); sendEvent(event); }
/** * Preload the JBoss specific protocol handlers, so that URL knows about * them even if the handler factory is changed. */ @SuppressWarnings("unused") public static void preload() { for (int i = 0; i < PROTOCOLS.length; i ++) { try { URL url = new URL(PROTOCOLS[i], "", -1, ""); log.trace("Loaded protocol: " + PROTOCOLS[i]); } catch (Exception e) { log.warn("Failed to load protocol: " + PROTOCOLS[i], e); } } }
/** public for tests only, not through API */ public void handleException(List<JDBCJournalRecord> recordRef, Throwable e) { logger.warn(e.getMessage(), e); failed.set(true); criticalIOErrorListener.onIOException(e, "Critical IO Error. Failed to process JDBC Record statements", null); if (logger.isTraceEnabled()) { logger.trace("Rolling back Transaction, just in case"); } try { connection.rollback(); } catch (Throwable rollback) { logger.warn(rollback); } try { connection.close(); } catch (Throwable rollback) { logger.warn(rollback); } if (recordRef != null) { executeCallbacks(recordRef, false); } }
protected void jbossInternalCreate() throws Exception { // if (state == CREATED || state == STARTING || state == STARTED // || state == STOPPING || state == STOPPED) if (state != REGISTERED) { createIgnored = true; if (log.isDebugEnabled()) { log.debug("Ignoring create call; current state is " + getStateString()); } return; } createIgnored = false; if (log.isDebugEnabled()) { log.debug("Creating " + jbossInternalDescription()); } try { createService(); state = CREATED; } catch (Exception e) { log.warn(ServiceMBeanLogger.ROOT_LOGGER.initializationFailed(jbossInternalDescription()), e); throw e; } if (log.isDebugEnabled()) { log.debug("Created " + jbossInternalDescription()); } if (startIgnored) { start(); } }
public void onException(JMSException exception) { if (isDestroyed) { if (log.isTraceEnabled()) { log.trace("Ignoring error on already destroyed connection " + this, exception); } return; } log.warn("Handling jms exception failure: " + this, exception); // We need to unlock() before sending the connection error to the // event listeners. Otherwise the lock won't be in sync once // cleanup() is called if (lock.isLocked() && Thread.currentThread().equals(lock.getOwner())) { unlock(); } try { con.setExceptionListener(null); } catch (JMSException e) { log.debug("Unable to unset exception listener", e); } ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception); sendEvent(event); }
public void putInContext(String key, Object value) { log.trace("putInContext " + key + "=" + value); if(value == null) throw new IllegalStateException("value must not be null for " + key); Object replaced = internalPutInContext(key,value); if(replaced!=null) { log.warn( "Overwriting " + replaced + " when setting " + key + " to " + value + "."); } }
public String getSerializedDelegationCredential() { if (delegationCredential == null) { if (log.isTraceEnabled()) { log.trace("No delegation credential available."); } return null; } try { if (log.isTraceEnabled()) { log.trace("Serializing credential " + delegationCredential); } return KerberosSerializationUtils.serializeCredential(kerberosTicket, delegationCredential); } catch (KerberosSerializationUtils.KerberosSerializationException kse) { log.warn("Couldn't serialize credential: " + delegationCredential, kse); return null; } }
stopIgnored = true; if (log.isDebugEnabled()) { log.debug("Ignoring stop call; current state is " + getStateString()); sendStateChangeNotification(STARTED, STOPPING, getName() + " stopping", null); if (log.isDebugEnabled()) { log.debug("Stopping " + jbossInternalDescription()); state = FAILED; sendStateChangeNotification(STOPPING, FAILED, getName() + " failed", e); log.warn(ServiceMBeanLogger.ROOT_LOGGER.stoppingFailed(jbossInternalDescription()), e); return; sendStateChangeNotification(STOPPING, STOPPED, getName() + " stopped", null); if (log.isDebugEnabled()) { log.debug("Stopped " + jbossInternalDescription());
@Override public void log(Marker marker, String fqcn, int level, String message, Object[] argArray, Throwable t) { FormattingTuple result = MessageFormatter.arrayFormat(message, argArray); switch (level) { case LocationAwareLogger.TRACE_INT: logger.trace(fqcn, result.getMessage(), t); break; case LocationAwareLogger.DEBUG_INT: logger.debug(fqcn, result.getMessage(), t); break; case LocationAwareLogger.INFO_INT: logger.info(fqcn, result.getMessage(), t); break; case LocationAwareLogger.WARN_INT: logger.warn(fqcn, result.getMessage(), t); break; case LocationAwareLogger.ERROR_INT: logger.error(fqcn, result.getMessage(), t); break; default: throw new IllegalStateException("Level number " + level + " is not recognized."); } }