avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-logkit/src/java/org/apache/log/output ServletOutputLogTarget.java
Date Thu, 01 Mar 2001 13:41:40 GMT
donaldp     01/03/01 05:41:40

  Added:       src/java/org/apache/log/output ServletOutputLogTarget.java
  Log:
  ServletLogTarget for logging within a servlet context.
  
  Submitted By: Tommy Santoso <Tommy.Santoso@osa.de>
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-logkit/src/java/org/apache/log/output/ServletOutputLogTarget.java
  
  Index: ServletOutputLogTarget.java
  ===================================================================
  package org.apache.log.output;
  
  import javax.servlet.ServletContext;
  import org.apache.log.output.DefaultOutputLogTarget;
  
  /**
   * Generic logging interface. Implementations are based on the strategy
   * pattern.
   * @author <a href="mailto:Tommy.Santoso@osa.de">Tommy Santoso</a>
   */
  public class ServletOutputLogTarget
      extends DefaultOutputLogTarget
  {
      private ServletContext context = null;
  
      /**
       * Constructor.
       *
       * @param context ServletContext to use for logging.
       */
      public ServletOutputLogTarget( final ServletContext context )
      {
          this.context = context;
      }
  
      /**
       * Logs message to servlet context log file
       *
       * @param message message to log to servlet context log file.
       */
      protected void output( final String message )
      {
          if( null != context )
          {
              synchronized( this )
              {
                  context.log( message );
              }
          }
      }
  }
  
  
  

Mime
View raw message