Esempio n. 1
0
 @SuppressWarnings("unchecked")
 public Iterator<Appender<ILoggingEvent>> iteratorForAppenders() {
   if (aai == null) {
     return Collections.EMPTY_LIST.iterator();
   }
   return aai.iteratorForAppenders();
 }
Esempio n. 2
0
  public void invoke(Request request, Response response) throws IOException, ServletException {

    try {

      if (!alreadySetLogbackStatusManager) {
        alreadySetLogbackStatusManager = true;
        org.apache.catalina.Context tomcatContext = request.getContext();
        if (tomcatContext != null) {
          ServletContext sc = tomcatContext.getServletContext();
          if (sc != null) {
            sc.setAttribute(AccessConstants.LOGBACK_STATUS_MANAGER_KEY, getStatusManager());
          }
        }
      }

      getNext().invoke(request, response);

      TomcatServerAdapter adapter = new TomcatServerAdapter(request, response);
      AccessEvent accessEvent = new AccessEvent(request, response, adapter);

      if (getFilterChainDecision(accessEvent) == FilterReply.DENY) {
        return;
      }

      // TODO better exception handling
      aai.appendLoopOnAppenders(accessEvent);
    } finally {
      request.removeAttribute(AccessConstants.LOGBACK_STATUS_MANAGER_KEY);
    }
  }
Esempio n. 3
0
 private int appendLoopOnAppenders(ILoggingEvent event) {
   if (aai != null) {
     return aai.appendLoopOnAppenders(event);
   } else {
     return 0;
   }
 }
Esempio n. 4
0
 public void log(Request jettyRequest, Response jettyResponse) {
   JettyServerAdapter adapter = new JettyServerAdapter(jettyRequest, jettyResponse);
   AccessEvent accessEvent = new AccessEvent(jettyRequest, jettyResponse, adapter);
   if (getFilterChainDecision(accessEvent) == FilterReply.DENY) {
     return;
   }
   aai.appendLoopOnAppenders(accessEvent);
 }
Esempio n. 5
0
 public void detachAndStopAllAppenders() {
   aai.detachAndStopAllAppenders();
 }
Esempio n. 6
0
 public boolean isAttached(Appender<AccessEvent> appender) {
   return aai.isAttached(appender);
 }
Esempio n. 7
0
 public Appender<AccessEvent> getAppender(String name) {
   return aai.getAppender(name);
 }
Esempio n. 8
0
 public Iterator<Appender<AccessEvent>> iteratorForAppenders() {
   return aai.iteratorForAppenders();
 }
Esempio n. 9
0
 public void addAppender(Appender<AccessEvent> newAppender) {
   aai.addAppender(newAppender);
 }
Esempio n. 10
0
 public void stop() {
   aai.detachAndStopAllAppenders();
   started = false;
 }
Esempio n. 11
0
 public boolean detachAppender(String name) {
   if (aai == null) {
     return false;
   }
   return aai.detachAppender(name);
 }
Esempio n. 12
0
 /** Remove the appender passed as parameter form the list of appenders. */
 public boolean detachAppender(Appender<ILoggingEvent> appender) {
   if (aai == null) {
     return false;
   }
   return aai.detachAppender(appender);
 }
Esempio n. 13
0
 public Appender<ILoggingEvent> getAppender(String name) {
   if (aai == null) {
     return null;
   }
   return aai.getAppender(name);
 }
Esempio n. 14
0
 public boolean isAttached(Appender<ILoggingEvent> appender) {
   if (aai == null) {
     return false;
   }
   return aai.isAttached(appender);
 }
Esempio n. 15
0
 // this method MUST be synchronized. See comments on 'aai' field for further
 // details.
 public synchronized void addAppender(Appender<ILoggingEvent> newAppender) {
   if (aai == null) {
     aai = new AppenderAttachableImpl<ILoggingEvent>();
   }
   aai.addAppender(newAppender);
 }
Esempio n. 16
0
 public boolean detachAppender(Appender<AccessEvent> appender) {
   return aai.detachAppender(appender);
 }
Esempio n. 17
0
 public boolean detachAppender(String name) {
   return aai.detachAppender(name);
 }
Esempio n. 18
0
 /**
  * Remove all previously added appenders from this logger instance.
  *
  * <p>This is useful when re-reading configuration information.
  */
 public void detachAndStopAllAppenders() {
   if (aai != null) {
     aai.detachAndStopAllAppenders();
   }
 }