本文整理了Java中org.apache.juli.logging.Log.isDebugEnabled()
方法的一些代码示例,展示了Log.isDebugEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log.isDebugEnabled()
方法的具体详情如下:
包路径:org.apache.juli.logging.Log
类名称:Log
方法名:isDebugEnabled
[英]Is debug logging currently enabled?
Call this method to prevent having to perform expensive operations (for example, String
concatenation) when the log level is more than debug.
[中]调试日志记录当前是否启用?
调用此方法以防止在日志级别高于调试级别时执行昂贵的操作(例如,String
串联)。
代码示例来源:origin: apache/geode
if (manager.getLogger().isDebugEnabled()) {
StringBuilder builder = new StringBuilder();
builder.append(this).append(": Handling failover of session ").append(sessionId)
.append(" from ").append(requestJvmRoute).append(" to ").append(localJvmRoute);
manager.getLogger().debug(builder.toString());
builder.append(this).append(": Caught exception attempting to find session ")
.append(sessionId).append(" in ").append(manager);
manager.getLogger().warn(builder.toString(), e);
builder.append(this).append(": Did not find session ").append(sessionId)
.append(" to failover in ").append(manager);
manager.getLogger().warn(builder.toString());
} else {
代码示例来源:origin: apache/geode
protected void unregisterJvmRouteBinderValve() {
if (getLogger().isDebugEnabled()) {
getLogger().debug(this + ": Unregistering JVM route binder valve");
}
if (jvmRouteBinderValve != null) {
getPipeline().removeValve(jvmRouteBinderValve);
}
}
代码示例来源:origin: apache/geode
if (getLogger().isDebugEnabled()) {
getLogger().debug(this + ": Starting");
init();
} catch (Throwable t) {
getLogger().error(t.getMessage(), t);
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
@Override
public URL getURL() {
String url = baseUrl + "!/";
try {
return new URL(url);
} catch (MalformedURLException e) {
if (log.isDebugEnabled()) {
log.debug(sm.getString("fileResource.getUrlFail", url), e);
}
return null;
}
}
代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource
private static void logFull(Log loghelper, int currentThreadCount,
int maxThreads) {
if( logfull ) {
log.error(sm.getString("threadpool.busy",
new Integer(currentThreadCount),
new Integer(maxThreads)));
logfull=false;
} else if( log.isDebugEnabled() ) {
log.debug("All threads are busy " + currentThreadCount + " " +
maxThreads );
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
} else {
if (getPoolProperties().getLogValidationErrors()) {
log.error("Custom validation through "+poolProperties.getValidator()+" failed.");
} catch (Exception ex) {
if (getPoolProperties().getLogValidationErrors()) {
log.warn("SQL Validation error", ex);
} else if (log.isDebugEnabled()) {
log.debug("Unable to validate object:",ex);
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
private boolean checkOverflow(int numBytes) {
if (pos + numBytes + 3 > buf.length) {
log.error(sm.getString("ajpmessage.overflow", "" + numBytes, "" + pos),
new ArrayIndexOutOfBoundsException());
if (log.isDebugEnabled()) {
dump("Overflow/coBytes");
}
return true;
}
return false;
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina-ha
/**
* Find the master of the session state
* @return master member of sessions
*/
protected Member findSessionMasterMember() {
Member mbr = null;
Member mbrs[] = cluster.getMembers();
if(mbrs.length != 0 ) mbr = mbrs[0];
if(mbr == null && log.isWarnEnabled()) log.warn(sm.getString("deltaManager.noMasterMember",getName(), ""));
if(mbr != null && log.isDebugEnabled()) log.warn(sm.getString("deltaManager.foundMasterMember",getName(), mbr));
return mbr;
}
代码示例来源:origin: codefollower/Tomcat-Research
@Override
public URL getURL() {
try {
return new URL(baseUrl + "!/");
} catch (MalformedURLException e) {
if (log.isDebugEnabled()) {
log.debug(sm.getString("fileResource.getUrlFail",
"", baseUrl), e);
}
return null;
}
}
代码示例来源:origin: apache/geode
@Override
public Principal getPrincipal() {
if (this.principal == null && this.serializedPrincipal != null) {
SerializablePrincipal sp = null;
try {
sp = (SerializablePrincipal) BlobHelper.deserializeBlob(this.serializedPrincipal);
} catch (Exception e) {
StringBuilder builder = new StringBuilder();
builder.append(this).append(
": Serialized principal contains a byte[] that cannot be deserialized due to the following exception");
((DeltaSessionManager) getManager()).getLogger().warn(builder.toString(), e);
return null;
}
this.principal =
sp.getPrincipal(((DeltaSessionManager) this.manager).getTheContext().getRealm());
if (getManager() != null) {
DeltaSessionManager mgr = (DeltaSessionManager) getManager();
if (mgr.getLogger().isDebugEnabled()) {
mgr.getLogger().debug(this + ": Deserialized principal: " + this.principal);
// mgr.logCurrentStack();
}
}
}
return this.principal;
}
代码示例来源:origin: apache/geode
protected void unregisterCommitSessionValve() {
if (getLogger().isDebugEnabled()) {
getLogger().debug(this + ": Unregistering CommitSessionValve");
}
if (commitSessionValve != null) {
getPipeline().removeValve(commitSessionValve);
}
}
代码示例来源:origin: apache/geode
getLogger().debug("No session store file found");
return;
if (getLogger().isDebugEnabled()) {
getLogger().debug("Loading sessions from " + store.getAbsolutePath());
if (getLogger().isDebugEnabled()) {
getLogger().debug("Creating custom object input stream for class loader");
if (getLogger().isDebugEnabled()) {
getLogger().debug("Creating standard object input stream");
if (getLogger().isDebugEnabled()) {
getLogger().debug("No persisted data file found");
Integer count = (Integer) ois.readObject();
int n = count.intValue();
if (getLogger().isDebugEnabled()) {
getLogger().debug("Loading " + n + " persisted sessions");
if (getLogger().isDebugEnabled()) {
getLogger().debug("Loaded session " + session.getId() + " is older than cached copy");
if (getLogger().isDebugEnabled()) {
getLogger().debug("Loaded session " + session.getId() + " is invalid");
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Process a "stop" event for this Host.
*/
public void stop() {
if (log.isDebugEnabled())
log.debug(sm.getString("hostConfig.stop"));
if (oname != null) {
try {
Registry.getRegistry(null, null).unregisterComponent(oname);
} catch (Exception e) {
log.error(sm.getString("hostConfig.jmx.unregister", oname), e);
}
}
oname = null;
}
代码示例来源:origin: camunda/camunda-bpm-platform
log.warn("maxActive is smaller than 1, setting maxActive to: "+PoolProperties.DEFAULT_MAX_ACTIVE);
properties.setMaxActive(PoolProperties.DEFAULT_MAX_ACTIVE);
log.warn("initialSize is larger than maxActive, setting initialSize to: "+properties.getMaxActive());
properties.setInitialSize(properties.getMaxActive());
log.warn("minIdle is larger than maxActive, setting minIdle to: "+properties.getMaxActive());
properties.setMinIdle(properties.getMaxActive());
for (int i=0; i<proxies.length; i++) {
try {
if (log.isDebugEnabled()) {
log.debug("Creating interceptor instance of class:"+proxies[i].getInterceptorClass());
interceptor.poolStarted(this);
}catch (Exception x) {
log.error("Unable to inform interceptor of pool start.",x);
if (jmxPool!=null) jmxPool.notify(org.apache.tomcat.jdbc.pool.jmx.ConnectionPool.NOTIFY_INIT, getStackTrace(x));
close(true);
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
@Override
public URL getURL() {
String url = baseUrl + "!/";
try {
return new URL(url);
} catch (MalformedURLException e) {
if (log.isDebugEnabled()) {
log.debug(sm.getString("fileResource.getUrlFail", url), e);
}
return null;
}
}
代码示例来源:origin: magro/memcached-session-manager
protected void releaseLock( @Nonnull final String sessionId ) {
try {
if ( _log.isDebugEnabled() ) {
_log.debug( "Releasing lock for session " + sessionId );
}
final long start = System.currentTimeMillis();
_storage.delete( _sessionIdFormat.createLockName( sessionId ) ).get();
_stats.registerSince( RELEASE_LOCK, start );
} catch ( final Exception e ) {
_log.warn( "Caught exception when trying to release lock for session " + sessionId, e );
}
}
代码示例来源:origin: apache/geode
@Override
public void run() {
// Get the sessionIds to touch and clear the set inside synchronization
Set<String> sessionIds = null;
sessionIds = new HashSet<String>(getSessionsToTouch());
getSessionsToTouch().clear();
// Touch the sessions we currently have
if (!sessionIds.isEmpty()) {
getSessionCache().touchSessions(sessionIds);
if (getLogger().isDebugEnabled()) {
getLogger().debug(DeltaSessionManager.this + ": Touched sessions: " + sessionIds);
}
}
}
};
代码示例来源:origin: apache/geode
getLogger().debug("Query: " + query.getQueryString());
results = (SelectResults) query.execute();
} catch (Exception ex) {
getLogger().error("Unable to perform query during doUnload", ex);
return;
getLogger().debug("No sessions to unload for context " + context.getPath());
return; // nothing to do
return;
if (getLogger().isDebugEnabled()) {
getLogger().debug("Unloading sessions to " + store.getAbsolutePath());
if (getLogger().isDebugEnabled())
getLogger().debug("Unloading " + list.size() + " sessions");
try {
getLogger().error("Exception unloading sessions", e);
try {
oos.close();
if (getLogger().isDebugEnabled()) {
getLogger().debug("Locally destroying session " + session.getId());
if (getLogger().isDebugEnabled()) {
getLogger().debug("Unloading complete");
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Process a "stop" event for this Host.
*/
public void stop() {
if (log.isDebugEnabled())
log.debug(sm.getString("hostConfig.stop"));
if (oname != null) {
try {
Registry.getRegistry(null, null).unregisterComponent(oname);
} catch (Exception e) {
log.error(sm.getString("hostConfig.jmx.unregister", oname), e);
}
}
oname = null;
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
@Override
public String getCanonicalPath() {
try {
return resource.getCanonicalPath();
} catch (IOException ioe) {
if (log.isDebugEnabled()) {
log.debug(sm.getString("fileResource.getCanonicalPathFail",
resource.getPath()), ioe);
}
return null;
}
}
内容来源于网络,如有侵权,请联系作者删除!