Log4cplus- How often does SocketAppender opens and closes the socket

1573 views sockets

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?

answered question

1 Answer


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


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

posted this

Have an answer?


Please login first before posting an answer.