logback-android/src/main/java/ch/qos/logback/classic/net/SocketNode.java
public void run() {

    try {
      hardenedLoggingEventInputStream = new HardenedLoggingEventInputStream(new BufferedInputStream(socket.getInputStream()));
    } catch (Exception e) {
      logger.error("Could not open ObjectInputStream to " + socket, e);
      closed = true;
    }

    ILoggingEvent event;
    Logger remoteLogger;

    try {
      while (!closed) {
        // read an event from the wire
        event = (ILoggingEvent) hardenedLoggingEventInputStream.readObject();
        // get a logger from the hierarchy. The name of the logger is taken to
        // be the name contained in the event.
        remoteLogger = context.getLogger(event.getLoggerName());
        // apply the logger-level filter
        if (remoteLogger.isEnabledFor(event.getLevel())) {
          // finally log the event as if was generated locally
          remoteLogger.callAppenders(event);
        }
      }
    } catch (java.io.EOFException e) {
      logger.info("Caught java.io.EOFException closing connection.");
    } catch (java.net.SocketException e) {
      logger.info("Caught java.net.SocketException closing connection.");
    } catch (IOException e) {
      logger.info("Caught java.io.IOException: " + e);
      logger.info("Closing connection.");
    } catch (Exception e) {
      logger.error("Unexpected exception. Closing connection.", e);
    }

    socketServer.socketNodeClosing(this);
    close();
  }
public void run() {

    try {
      hardenedLoggingEventInputStream = new HardenedLoggingEventInputStream(new BufferedInputStream(socket.getInputStream()));
    } catch (Exception e) {
      logger.error("Could not open ObjectInputStream to " + socket, e);
      closed = true;
    }

    ILoggingEvent event;
    Logger remoteLogger;

    try {
      while (!closed) {
        // read an event from the wire
        event = (ILoggingEvent) hardenedLoggingEventInputStream.readObject();
        // get a logger from the hierarchy. The name of the logger is taken to
        // be the name contained in the event.
        remoteLogger = context.getLogger(event.getLoggerName());
        // apply the logger-level filter
        if (remoteLogger.isEnabledFor(event.getLevel())) {
          // finally log the event as if was generated locally
          remoteLogger.callAppenders(event);
        }
      }
    } catch (java.io.EOFException e) {
      logger.info("Caught java.io.EOFException closing connection.");
    } catch (java.net.SocketException e) {
      logger.info("Caught java.net.SocketException closing connection.");
    } catch (IOException e) {
      logger.info("Caught java.io.IOException: " + e);
      logger.info("Closing connection.");
    } catch (Exception e) {
      logger.error("Unexpected exception. Closing connection.", e);
    }

    socketServer.socketNodeClosing(this);
    close();
  }
public void run ( ) { try { hardenedLoggingEventInputStream = new HardenedLoggingEventInputStream ( new BufferedInputStream ( socket . getInputStream ( ) ) ) ; } catch ( Exception e ) { logger . error ( "Could not open ObjectInputStream to " + socket , e ) ; closed = true ; } ILoggingEvent event ; Logger remoteLogger ; try { while ( ! closed ) { // read an event from the wire event = ( ILoggingEvent ) hardenedLoggingEventInputStream . readObject ( ) ; // get a logger from the hierarchy. The name of the logger is taken to // be the name contained in the event. remoteLogger = context . getLogger ( event . getLoggerName ( ) ) ; // apply the logger-level filter if ( remoteLogger . isEnabledFor ( event . getLevel ( ) ) ) { // finally log the event as if was generated locally remoteLogger . callAppenders ( event ) ; } } } catch ( java . io . EOFException e ) { logger . info ( "Caught java.io.EOFException closing connection." ) ; } catch ( java . net . SocketException e ) { logger . info ( "Caught java.net.SocketException closing connection." ) ; } catch ( IOException e ) { logger . info ( "Caught java.io.IOException: " + e ) ; logger . info ( "Closing connection." ) ; } catch ( Exception e ) { logger . error ( "Unexpected exception. Closing connection." , e ) ; } socketServer . socketNodeClosing ( this ) ; close ( ) ; }
}
}