本文整理了Java中org.eclipse.jetty.util.log.Log
类的一些代码示例,展示了Log
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log
类的具体详情如下:
包路径:org.eclipse.jetty.util.log.Log
类名称:Log
[英]Logging. This class provides a static logging interface. If an instance of the org.slf4j.Logger class is found on the classpath, the static log methods are directed to a slf4j logger for "org.eclipse.log". Otherwise the logs are directed to stderr.
The "org.eclipse.jetty.util.log.class" system property can be used to select a specific logging implementation.
If the system property org.eclipse.jetty.util.log.IGNORED is set, then ignored exceptions are logged in detail.
[中]登录中。此类提供了一个静态日志记录接口。如果是组织的一个实例。slf4j。Logger类位于类路径上,静态日志方法被定向到“org.eclipse.log”的slf4j记录器。否则,日志将被定向到stderr。
“org.eclipse.jetty.util.log.class”系统属性可用于选择特定的日志实现。
如果系统属性为“组织”。日食码头。util。日志设置忽略,然后详细记录忽略的异常。
代码示例来源:origin: apache/incubator-dubbo
Log.setLog(new StdErrLog());
Log.getLog().setDebugEnabled(false);
代码示例来源:origin: org.eclipse.jetty/jetty-util
@Override
public void failed(Throwable x)
{
Log.getLogger(this.getClass()).warn(x);
}
}
代码示例来源:origin: org.eclipse.jetty/jetty-util
@Override
public final Logger getLogger(String name)
{
if (isBlank(name))
return this;
final String basename = getName();
final String fullname = (isBlank(basename) || Log.getRootLogger()==this)?name:(basename + "." + name);
Logger logger = Log.getLoggers().get(fullname);
if (logger == null)
{
Logger newlog = newLogger(fullname);
logger = Log.getMutableLoggers().putIfAbsent(fullname,newlog);
if (logger == null)
logger=newlog;
}
return logger;
}
代码示例来源:origin: org.eclipse.jetty/jetty-util
Method getLogger = uberlog.getMethod("getLogger", new Class[]{String.class});
Object logger = getLogger.invoke(null,name);
setLog(new LoggerLog(logger));
setLog(getLogger(name));
代码示例来源:origin: org.eclipse.jetty/jetty-util
if(announce)
LOG.debug("Logging to {} via {}", LOG, log_class.getName());
initStandardLogging(e);
LOG.info(String.format("Logging initialized @%dms to %s",Uptime.getUptime(),LOG.getClass().getName()));
代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app
/**
* Notify the URL just once. Use best effort.
*/
protected boolean notifyURLOnce() {
boolean success = false;
try {
Log.getLog().info("Job end notification trying " + urlToNotify);
HttpURLConnection conn =
(HttpURLConnection) urlToNotify.openConnection(proxyToUse);
conn.setConnectTimeout(timeout);
conn.setReadTimeout(timeout);
conn.setAllowUserInteraction(false);
if(conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
Log.getLog().warn("Job end notification to " + urlToNotify
+ " failed with code: " + conn.getResponseCode() + " and message \""
+ conn.getResponseMessage() + "\"");
}
else {
success = true;
Log.getLog().info("Job end notification to " + urlToNotify
+ " succeeded");
}
} catch(IOException ioe) {
Log.getLog().warn("Job end notification to " + urlToNotify + " failed",
ioe);
}
return success;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public static boolean initialized()
{
if (LOG != null)
{
return true;
}
synchronized (Log.class)
{
if (__initialized)
{
return LOG != null;
}
__initialized = true;
}
try
{
Class<?> log_class = Loader.loadClass(Log.class, __logClass);
if (LOG == null || !LOG.getClass().equals(log_class))
{
LOG = (Logger)log_class.newInstance();
LOG.debug("Logging to {} via {}", LOG, log_class.getName());
}
}
catch(Throwable e)
{
// Unable to load specified Logger implementation, default to standard logging.
initStandardLogging(e);
}
return LOG != null;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)}
*/
@Deprecated
public static void debug(String msg)
{
if (!initialized())
return;
LOG.debug(msg);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)}
*/
@Deprecated
public static void warn(String msg, Throwable th)
{
if (!initialized())
return;
LOG.warn(msg, th);
}
代码示例来源:origin: org.eclipse.jetty/jetty-util
public StacklessLogging(Class<?>... classesToSquelch)
{
for (Class<?> clazz : classesToSquelch)
{
Logger log = Log.getLogger(clazz);
// only operate on loggers that are of type StdErrLog
if (log instanceof StdErrLog && !log.isDebugEnabled())
{
StdErrLog stdErrLog=((StdErrLog)log);
if (!stdErrLog.isHideStacks())
{
stdErrLog.setHideStacks(true);
squelched.add(stdErrLog);
}
}
}
}
代码示例来源:origin: io.tesla.aether.test/aether-test-harness
private void behave(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
Log.getLog().debug("behaving: " + req.getPathInfo() + ", " + Arrays.toString(behaviour));
try {
Map<Object, Object> ctx = new HashMap<Object, Object>();
for (Behaviour b : behaviour) {
if (!b.execute(req, resp, ctx)) {
break;
}
}
} catch (Exception e) {
throw new ServletException(e.getMessage(), e);
}
}
代码示例来源:origin: bitronix/btm
protected void doStart() throws Exception {
Log.getLog().info("Starting Bitronix Transaction Manager");
TransactionManagerServices.getTransactionManager();
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)}
*/
@Deprecated
public static void info(String msg, Object arg0, Object arg1)
{
if (!initialized())
return;
LOG.info(msg, arg0, arg1);
}
代码示例来源:origin: jphp-group/jphp
@Override
public void onRegister(CompileScope scope) {
registerWrapperClass(scope, Session.class, PWebSocketSession.class);
MemoryOperation.registerWrapper(WebSocketSession.class, PWebSocketSession.class);
registerClass(scope, PHttpServer.class);
registerClass(scope, PHttpServerRequest.class);
registerClass(scope, PHttpServerResponse.class);
registerClass(scope, PHttpAbstractHandler.class);
registerClass(scope, PHttpRouteFilter.class);
registerClass(scope, PHttpRouteHandler.class);
registerClass(scope, PHttpRedirectHandler.class);
registerClass(scope, PHttpDownloadFileHandler.class);
registerClass(scope, PHttpResourceHandler.class);
registerClass(scope, PHttpCORSFilter.class);
registerClass(scope, PHttpGzipFilter.class);
Log.setLog(new NoLogging());
}
}
代码示例来源:origin: i2p/i2p.i2p
protected void doStop() throws Exception
{
super.doStop();
try {if (_writer != null) _writer.flush();} catch (IOException e) {Log.getLogger((String)null).ignore(e);}
if (_out != null && _closeOut)
try {_out.close();} catch (IOException e) {Log.getLogger((String)null).ignore(e);}
_out = null;
_fileOut = null;
_closeOut = false;
_logDateCache = null;
_writer = null;
_buffers = null;
_copy = null;
}
代码示例来源:origin: i2p/i2p.i2p
Log.getLogger((String)null).info("Opened "+getDatedFilename());
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)}
*/
@Deprecated
public static boolean isDebugEnabled()
{
if (!initialized())
return false;
return LOG.isDebugEnabled();
}
代码示例来源:origin: org.eclipse.jetty/jetty-util
Log.getRootLogger().ignore(x);
buf.append("!!concurrent mod!!");
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)}
*/
@Deprecated
public static void ignore(Throwable thrown)
{
if (!initialized())
return;
LOG.ignore(thrown);
}
代码示例来源:origin: org.eclipse.jetty/jetty-util
private Logger getJettyLogger(String loggerName)
{
return org.eclipse.jetty.util.log.Log.getLogger(loggerName);
}
内容来源于网络,如有侵权,请联系作者删除!