Refine search
Log.setLog(new StdErrLog()); Log.getLog().setDebugEnabled(false);
@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; }
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()));
/** * 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; }
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; }
/** * @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); }
/** * @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); }
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); } } } }
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); } }
/** * @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); }
@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()); } }
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; }
/** * @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(); }
Log.getRootLogger().ignore(x); buf.append("!!concurrent mod!!");
/** * @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); }
private Logger getJettyLogger(String loggerName) { return org.eclipse.jetty.util.log.Log.getLogger(loggerName); }