0

I want to use Log4cplus SocketAppender to open TCP socket to a remote server and send events (log messages) to that server.

Since my application has quite a lot of log messages to send, I wish to know -

How often does the SocketAppender opens and closes connections to the remote server? does it occur on every single message that is sent? or in other frequency?

I want to prevent a state of connection "exhaustion" between the log messages sender and the remote server in case of high frequency of log messages sent.

Does the SocketAppender prevent this from occurring?

N.avraham
  • 333
  • 2
  • 15

1 Answers1

0

The connection is dropped when the close method is called , the following is copied from the documentation

https://log4cplus.sourceforge.io/docs/html/classlog4cplus_1_1SocketAppender.html

virtual void close () Release any resources allocated within the appender such as file handles, network connections, etc. More...

newbie
  • 558
  • 7
  • 12
  • According to the documentation: "if the network connection is slower then the rate of event production, then the client can only progress at the network rate. In particular, if the network link to the the server is down, the client will be blocked." so I am wondering- using AsyncAppender can resolve this blocking state? And using the AsynAppender on this socketAppender is applicable? – N.avraham Nov 04 '18 at 18:42
  • 1
    I would expect AsyncAppender to resolve the client blocking state, however the resources needed for these Async calls would be building up on the client application , they would be getting processed any faster – newbie Nov 04 '18 at 18:56