Package org.gudy.azureus2.core3.logging

Examples of org.gudy.azureus2.core3.logging.LogEvent


            drop  = true;
           
              if (Logger.isEnabled()){
               
                Logger.log(
                  new LogEvent(
                    LOGID, LogEvent.LT_INFORMATION,
                    "Persistent ban dropped as too old : "
                      + ip + ", " + desc));
                }
          }
View Full Code Here


      }
     
        if ( addBlockedIP( new BlockedIpImpl( ipAddress, match, torrent_name, loggable), torrent_hash, loggable )){
       
          if (Logger.isEnabled())
            Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Ip Blocked : "
                + ipAddress + ", in range : " + match));
         
          return true;
         
        }else{
         
          if (Logger.isEnabled())
          Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Ip Blocking Denied : "
              + ipAddress + ", in range : " + match));
       
          return false;
        }
      }
     
      return false
    }

 
    if( allow ){ 
     
    if ( AENetworkClassifier.categoriseAddress( ipAddress ) != AENetworkClassifier.AT_PUBLIC ){
       
      return( false );
    }
     
      if ( addBlockedIP( new BlockedIpImpl(ipAddress,null, torrent_name, loggable), torrent_hash, loggable )){
     
        if (Logger.isEnabled())
          Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Ip Blocked : "
              + ipAddress + ", not in any range"));
       
        return true;
       
      }else{
       
        if (Logger.isEnabled())
        Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Ip Blocking Denied : "
            + ipAddress + ", not in any range"));
     
        return false;
      }
    }
View Full Code Here

      if(!allow) {
             
        if ( addBlockedIP( new BlockedIpImpl(ipAddress.getHostAddress(),match, torrent_name, loggable), torrent_hash, loggable )){
       
          if (Logger.isEnabled())
            Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Ip Blocked : "
                + ipAddress + ", in range : " + match));
         
          return true;
         
        }else{
         
          if (Logger.isEnabled())
            Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Ip Blocking Denied: "
                + ipAddress + ", in range : " + match));
         
          return false;

        }
      }
     
      return false
    }

 
    if( allow ){ 
     
      if ( addBlockedIP( new BlockedIpImpl(ipAddress.getHostAddress(),null, torrent_name, loggable), torrent_hash, loggable )){
     
        if (Logger.isEnabled())
          Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Ip Blocked : "
              + ipAddress + ", not in any range"));
       
        return true;
      }else{
       
        if (Logger.isEnabled())
        Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Ip Blocking Denied : "
            + ipAddress + ", not in any range"));
     
        return false;
      }
    }
View Full Code Here

  public void log(LogAlert alert) {
    String logText = "Alert:" + alert.entryType + ":" + alert.text;

    // Log all Alerts as Events
    LogEvent alertEvent = new LogEvent(LogIDs.ALERT, alert.entryType,
        logText);
    alertEvent.err = alert.err;
    Logger.log(alertEvent);

    synchronized (this) {
View Full Code Here

      if (c == '\n') {
        if (!bLogToStdOut) {
          ps.println(buffer);
        }
        log(new LogEvent(logID, logType, buffer.toString()));
        buffer.setLength(0);
      } else if (c != '\r') {
        buffer.append(c);
      }
    }
View Full Code Here

    if ( client_ip_address != original_client_ip_address ){
     
      if ( Logger.isEnabled()){
       
        Logger.log(
          new LogEvent(LogIDs.TRACKER,
            "    address adjusted: original=" +  original_client_ip_address +
            ", real=" + real_ip_address +
            ", adjusted=" + client_ip_address +
            ", loopback=" + loopback ));
     
View Full Code Here

                    ips++;
                  }
                }             
              }
            }catch( Throwable e ){
              Logger.log(new LogEvent(LOGID, "", e));
            }
           
            if ( ips > 1 ){
             
              filter_override  = true;
             
              use_filter  = true;
             
              if (Logger.isEnabled())
                Logger.log(new LogEvent(LOGID,
                    "ClientIDManager: overriding filter "
                    + "option to support local bind IP"));
            }
          }
    }
   
    if ( use_filter ){
     
      try{
        thread_pool = new ThreadPool( "ClientIDManager", 32 );
       
          String  connect_timeout = System.getProperty("sun.net.client.defaultConnectTimeout");
          String  read_timeout   = System.getProperty("sun.net.client.defaultReadTimeout");
             
          int  timeout = Integer.parseInt( connect_timeout ) + Integer.parseInt( read_timeout );
       
        thread_pool.setExecutionLimit( timeout );
     
        final ServerSocket ss = new ServerSocket( 0, 1024, InetAddress.getByName("127.0.0.1"));
       
        filter_port  = ss.getLocalPort();
       
        ss.setReuseAddress(true);
               
        Thread accept_thread =
            new AEThread("ClientIDManager::filterloop")
            {
              public void
              runSupport()
              {
                long  successfull_accepts = 0;
                long  failed_accepts    = 0;

                while(true){
                 
                  try{       
                    Socket socket = ss.accept();
             
                    successfull_accepts++;
             
                    thread_pool.run( new httpFilter( socket ));
                   
                  }catch( Throwable e ){
                   
                    failed_accepts++;
                   
                    if (Logger.isEnabled())
                      Logger.log(new LogEvent(LOGID,
                                              "ClientIDManager: listener failed on port "
                                              + filter_port, e ));
                   
                    if ( failed_accepts > 100 && successfull_accepts == 0 ){

                        // looks like its not going to work...
                        // some kind of socket problem
                             
                      Logger.logTextResource(new LogAlert(LogAlert.UNREPEATABLE,
                        LogAlert.AT_ERROR, "Network.alert.acceptfail"),
                        new String[] { "" + filter_port, "TCP" });
                 
                      use_filter  = false;
                     
                      break;
                    }
                  }
                }
              }
            };
     
        accept_thread.setDaemon( true );
     
        accept_thread.start();                 
     
        if (Logger.isEnabled())
          Logger.log(new LogEvent(LOGID,
              "ClientIDManager: listener established on port " + filter_port));
       
      }catch( Throwable e){
     
        Logger.logTextResource(new LogAlert(LogAlert.UNREPEATABLE,
            LogAlert.AT_ERROR, "Tracker.alert.listenfail"), new String[] { ""
            + filter_port });
   
        if (Logger.isEnabled())
          Logger.log(new LogEvent(LOGID,
              "ClientIDManager: listener failed on port " + filter_port, e));
       
        use_filter  = false;
      }   
    }
View Full Code Here

              }
              description = matcher.group(1);
              startIp = matcher.group(2);
              endIp = matcher.group(3);
            } else {
              Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING,
                  "unrecognized line while reading ip filter: " + line));
            }
          }

          if (parseMode != 1) {
View Full Code Here

        }
      }

      // next: version no
      int p2bVersion = is.read();
      Logger.log(new LogEvent(LOGID, "Log Filter: loading p2b version "
          + p2bVersion));
      return p2bVersion;
    } catch (IOException e) {
      Debug.out(e);
    }
View Full Code Here

      BufferedInputStream bin = null;
      boolean isURL = false;
      try {
        //open the file
        String file = COConfigurationManager.getStringParameter(CFG_AUTOLOAD_FILE);
        Logger.log(new LogEvent(LOGID, "IP Filter file: " + file));
        File filtersFile = new File(file);
        if (filtersFile.exists()) {
          isURL = false;
        } else {
          if (!UrlUtils.isURL(file)) {
            return;
          }

          isURL = true;

          filtersFile = FileUtil.getUserFile("ipfilter.dl");
          if (filtersFile.exists()) {
            if (allowAsyncDownloading) {
              Logger.log(new LogEvent(LOGID, "Downloading " + file + "  async"));

              downloadFiltersAsync(new URL(file));

              if (!loadOldWhileAsyncDownloading) {
                return;
              }
            }
          } else {
            // no old dl, download sync now
            Logger.log(new LogEvent(LOGID, "sync Downloading " + file));
            try {
              ResourceDownloader rd = ResourceDownloaderFactoryImpl.getSingleton().create(
                  new URL(file));
              fin = rd.download();
              FileUtil.copyFile(fin, filtersFile);
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.logging.LogEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.