public synchronized void clearIndex() { if (log_.isDebugEnabled()) { log_.debug("clear index"); } File indexDir = new File(indexDirPath_); if (!indexDir.exists()) { indexDir.mkdirs(); if (log_.isInfoEnabled()) { log_.info("CREATE INDEX DIR: " + indexDirPath_); } } IndexWriter writer = null; try { writer = newIndexWriter(true); } catch (IOException ex) { throw new IORuntimeException(ex); } finally { if (writer != null) { try { writer.close(); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't close index writer", ex); } } } } }
public void doHandle(HttpServletRequest request, HttpServletResponse response, Exception ex, ExceptionHandlerChain chain) { if (response.isCommitted()) { // 既に何かが出力されてしまっているため、エラー画面へのフォワードはしないようにする。 log_.error("Exception has occured", ex); return; } if (log_.isDebugEnabled()) { log_.debug("Exception has occured", ex); } try { if (redirect_) { response.sendRedirect(response.encodeRedirectURL(ServletUtils .getURI(pathname_, request))); } else { request.getRequestDispatcher(pathname_).forward(request, response); } } catch (Throwable t) { log_.error("Exception has occured", ex); log_.error( "...and tried to handle this exception, but couldn't forward to: " + pathname_, t); } }
public void setThreshold(final int threshold) { if (log_.isDebugEnabled()) { log_.debug("setThreshold ignore: " + threshold); } }
public int getThreshold() { if (!log_.isTraceEnabled()) { return MavenEmbedderLogger.LEVEL_DISABLED; } if (!log_.isDebugEnabled()) { return MavenEmbedderLogger.LEVEL_DEBUG; } if (!log_.isInfoEnabled()) { return MavenEmbedderLogger.LEVEL_DEBUG; } if (!log_.isWarnEnabled()) { return MavenEmbedderLogger.LEVEL_INFO; } if (!log_.isErrorEnabled()) { return MavenEmbedderLogger.LEVEL_WARN; } if (!log_.isFatalEnabled()) { return MavenEmbedderLogger.LEVEL_ERROR; } return MavenEmbedderLogger.LEVEL_FATAL; }
log_.error("Spefify property: " + PROP_ANALYZERCLASSNAME); return false; String senHome = plugin.getProperty(PROP_SENHOME); if (senHome == null || senHome.trim().length() == 0) { log_.error("Specify plugin property: " + PROP_SENHOME); return false; if (log_.isInfoEnabled()) { log_.info("SET sen.home=" + senHome); .getInnerClassLoader()); } catch (ClassNotFoundException ex) { log_.error("Can't resolve class: " + analyzerClassName, ex); return false; log_.error("Specify property: " + PROP_INDEXDIRPATH); return false; if (!indexDir_.exists()) { indexDir_.mkdirs(); if (log_.isInfoEnabled()) { log_.info("CREATE INDEX DIR: " + indexDir_); indexDirPath_ = indexDir_.toFile().getCanonicalPath(); } catch (IOException ex) { log_.error("Can't resolve file path: " + indexDirPath, ex); return false;
public void error(final String message) { log_.error(message); }
if (pageGard == null) { log_ .warn("[SKIP] Corresponding page-gard does not exist: gard-id=" + pageGardInstall.getGardId() + ": " + pageGardInstall); continue; if (log_.isDebugEnabled()) { log_.debug("Install page-gard (" + pageGard.getFullId() + ") to path " + pathname); install(page, pageGardId); } catch (Throwable t) { log_.error("Install failed: pathname=" + pathname + ", gard-id=" + pageGardId); log_.error("Parent page does not exist: pathname=" + pathname + ", gard-id=" + pageGardId); continue; install(page, name, pageGardId); } catch (DuplicatePageException ex) { log_.error("Can't happen! target page already exists: " + "page=" + page + ", gard-id=" + pageGardId); } catch (Throwable t) { log_ .error("Install failed: parent page=" + page + ", name=" + name + ", gard-id=" + pageGardId, t);
if (log_.isDebugEnabled()) { log_.debug("Extension element has no id," + " so assigned automatically:" + " extension-point=" + element.getParent().getPoint() + ", plugin-id=" ExtensionElement old = replaceMap.get(fullId); if (old != null) { log_.info("Duplicate replace action: full-id=" + fullId + ", old=" + old + ", new=" + element); log_.warn("Duplicate entry. Skipped: full-id=" + fullId + ", old=" + old + ", new=" + element); } else { ExtensionElement element = entry2.getValue(); if (!sorted.containsKey(fullId)) { log_.warn("Replace action replaces NOTHING: full-id=" + fullId + ", element=" + element); } else { String fullId = itr2.next(); if (!sorted.containsKey(fullId)) { log_.warn("Remove action removes NOTHING: full-id=" + fullId); } else { sorted.remove(fullId);
log_.error("Exception has occured", ex); return; if (log_.isDebugEnabled()) { log_.debug("Exception has occured", ex); rd.forward(request, response); } catch (Throwable t) { log_.error("Exception has occured", ex); log_.error( "...and tried to handle this exception, but couldn't forward to: " + errorPage.getPathname(), t); log_.info("Exception has occured", ex);
public void warn(final String message, final Throwable throwable) { log_.warn(message, throwable); } }
sb.append(" UNDER DEVELOPMENT MODE"); log_.info(sb.toString()); log_.info("Plugin '" + plugin.getId() + "' has been successfully started."); } else { log_.error("Can't start plugin: plugin-id=" + plugin.getId(), throwable); failedPluginIdsToStart_ = (String[])ArrayUtil.add( plugin.stop(); } catch (Throwable t) { log_.warn("Can't stop plugin: id=" + plugin.getId(), t);
public SearchResult[] search(SearchQuery query) throws ParseException { if (log_.isDebugEnabled()) { log_.debug("QUERY STRING: " + query.getQueryString()); } Searcher searcher = null; try { searcher = new IndexSearcher(indexDirPath_); QueryStringParser parser = getQueryStringParser(); Query qry = (Query)parser.parse(query.getQueryString(), query .getOption()); return getSearchResults(query, searcher.search(qry)); } catch (IOException ex) { throw new IORuntimeException(ex); } finally { if (searcher != null) { try { searcher.close(); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't close searcher", ex); } } } } }
if (log_.isDebugEnabled()) { log_.debug("createClassLoader: id=" + descriptor.getId()); if (log_.isDebugEnabled()) { log_.debug("Replace '" + urls[j] + "' into '" + developedPluginClassesDirectory_ + "'"); if (log_.isDebugEnabled()) { log_.debug("[SKIP] Duplicate: " + urls[j]); if (log_.isDebugEnabled()) { log_.debug("Add to class loader: " + urls[j]); .toFile()); if (url == null) { log_.warn("Jar not found: " + developedPluginAdditinoalJars_[i]); if (log_.isDebugEnabled()) { log_.debug("[SKIP] Duplicate: " + url); if (log_.isDebugEnabled()) { log_.debug("Add to class loader: " + url); furlMap.put(classesURL, new FilteredURLClassLoader.FilteredURL( classesURL, Library.PATTERNS_ALL, Library.PATTERNS_ALL)); if (log_.isDebugEnabled()) { log_.debug("Add classes directory to class loader: " + developedPluginClassesDirectory_);
if (log_.isDebugEnabled()) { log_.debug("start plugins..."); log_.info("[SKIP] Plugin is disabled: plugin-id=" + id); enabledPluginMap_.remove(id); Class pluginIf = ClassUtils.getSubInterface(plugin.getClass(), if (log_.isDebugEnabled()) { log_.debug("successfully started: " + id);
public synchronized void removeFromIndex(int[] pageIds) { IndexReader reader = null; try { reader = IndexReader.open(indexDirPath_); for (int i = 0; i < pageIds.length; i++) { try { removeFromIndex(reader, pageIds[i]); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't remove from index: " + pageIds[i], ex); } } } } catch (IOException ex) { throw new IORuntimeException(ex); } finally { if (reader != null) { try { reader.close(); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't close index reader", ex); } } } } }
String id = extensionPoint.getId(); if (id == null) { log_.error("id must be specified: " + extensionPoint + ": plugin=" + pluginId); continue; log_.warn("element-class must be specified: " + extensionPoint + ": plugin=" + pluginId); continue; log_.warn("extension point is duplicated: id=" + fullId); continue;
public void doHandle(HttpServletRequest request, HttpServletResponse response, Exception ex, PageRequest pageRequest, PageExceptionHandlerChain chain) { // ログイン処理を開始する。 log_.debug("LOGIN PROCESS:" + " (1) Request authentication information to client"); setAuthenticationHeader(response, "Kvasir"); HttpSession session = request.getSession(true); session.setAttribute(BasicAuthenticationPageFilter.ATTR_AUTH_TRYING, "trying"); if (errorPage_ != null) { try { request.getRequestDispatcher( PageUtils.getAbsolutePathname(errorPage_, pageRequest .getMy().getGardRootPage(), pageRequest.getMy() .getPage())).forward(request, response); } catch (ServletException ex2) { log_.error("Can't forward to error page: " + errorPage_, ex2); } catch (IOException ex2) { log_.error("Can't forward to error page: " + errorPage_, ex2); } } else { // デフォルトの500エラー画面にするとauthentication headerが // 消されるっぽいので、他のハンドラが処理してくれないと // Basic認証できないことになることに注意。 chain.doHandle(request, response, ex, pageRequest); } }
sb.append(" UNDER DEVELOPMENT MODE"); log_.info(sb.toString()); kvasirLifecycleListeners_[i].notifyKvasirStarted(); } catch (Throwable t) { log_.error( "KvasirLifecycleListener has thrown exception when started: lifecycleListener=" + kvasirLifecycleListeners_[i], t); log_.info("Kvasir/Sora has been successfully started."); } else { sb = new StringBuilder(); log_.info(sb.toString());
public void info(final String message) { log_.info(message); }
public void debug(final String message, final Throwable throwable) { log_.debug(message, throwable); }