code: private synchronized void logEvent( int level, String string, Throwable throwable )
      {
          // Check if the event should be logged
          if ( level > _loggingLevel )
          {
              return;
          }
  
          if ( _logFile != null )
          {
              // No logfile specified, log using servlet context
              PrintWriter pw = null;
              try
              {
                  pw = new PrintWriter( new FileWriter( _logFile, true ) );
                  pw.println( _servletName + "(" + level + "): " + string );
                  if ( throwable != null )
                  {
                      throwable.printStackTrace( pw );
                  }
                  pw.close();
                  // Do a return here. An exception will cause a fall through to
                  // do _servletContex logging API
                  return;
              }
              catch ( IOException ioe )
              {
                  /* just ignore */
              }
          }
  
          // Otherwise, write to servlet context log
          if ( throwable == null )
          {
              _servletContext.log( string );
          }
          else
          {
              _servletContext.log( string, throwable );
          }
      }
docs: The method that actually does the logging