logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sambath Kumar" <Samba...@elind.com>
Subject RE: problem with socketappender
Date Wed, 31 Oct 2001 16:00:25 GMT
Hi,
  The above mentioned problem is occuring in LoggingServer when your
client application
  who uses socket appender to send log messages closes the socket
connection.

	This exactly means that your client application terminates after
sending only on log request.
      So try it inside the while loop, like
		while(true) {
			cat.debug("");
		}
	
  So there is no problem with socketappender or socket node. Your client
exits after one log request, that it the reason.

  If u send your LogClient i will try to help u if u have still doubts. 

Thanks,
P. Sambath Kumar.

-----Original Message-----
From: Tobias Flohre [mailto:log4j@gmx.de]
Sent: Wednesday, October 31, 2001 8:14 PM
To: log4j-dev@jakarta.apache.org
Subject: problem with socketappender


Hello everybody,

I have a problem with the socketappender.
Everytime I run my program, the socketconnection is closed by this:

2001-10-31 14:47:56,133 INFO  [Thread-5] net.SocketNode
(SocketNode.java:83)
- Caught java.net.SocketException closing conneciton.

It differs from run to run how many log-statements get through the
connection, but for sure the exception occurs at one time. Do you have
any suggestion?
For information: The server runs on the same machine as the application.
Here is the code of the class socketnode where the exception is thrown,
line
83 is indicated.

    try {
      while(true) {	
	event = (LoggingEvent) ois.readObject();	
	remoteCategory = hierarchy.getInstance(event.categoryName);
	event.category = remoteCategory;
	
if(event.priority.isGreaterOrEqual(remoteCategory.getChainedPriority()))
{
	  remoteCategory.callAppenders(event);	
	}
      }
    }
    catch(java.io.EOFException e) {
      cat.info("Caught java.io.EOFException closing conneciton.");
    }
    catch(java.net.SocketException e) {
      cat.info("Caught java.net.SocketException closing conneciton.");
83!!
    }
    catch(Exception e) {
      cat.error("Unexpected exception. Closing conneciton.", e);
    }
    
    try {
      ois.close();
    }
    catch(Exception e) {
      cat.info("Could not close connection.", e);	
    }  
  }
}


Thank you,
Tobias

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


--
To unsubscribe, e-mail:
<mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:log4j-dev-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>


Mime
View raw message