Comments (19)
SocketAppender
receiver is source is in the loggingserver.cxx
.
Log4jUdpAppender
sends the events using UDP to whoever wants to receive them. The other end can be Chainsaw GUI or any other compatible receiver like Log2Console
AsyncAppender
is there to outsource possibly time consuming appending to separate thread. It is relevant on older branches than master. On master, there is a thread pool that does that same for all appenders automatically.
SysLogAppender
can be used to append against any syslog server. Initially, it was UDP only, newer versions support TCP as well.
from log4cplus.
SocketAppender model has memory leak under high press. It's so ungly, could it will be fixed?
Or give a tiny code analysis.
from log4cplus.
@hlee13 I am not aware of any leaks. You will have to specify it a little bit more.
from log4cplus.
briefly, i use SocketAppender as Client Appender, and logginserver.cxx as server.
pic is server process by top command .
from log4cplus.
when logger in down, SocketAppender will reopen socket , is that socket release, fd leaks is abvirous.
from log4cplus.
@hlee13 OK, that looks like a socket handle leak. What version are you using?
from log4cplus.
version 1.1.2 release
perhaps memory leaks is non-relative with fd leaks, yet that is a problem.
I care about memory leaks as well as fd.
from log4cplus.
@hlee13 Well, I do not immediately see anything wrong. Are you able to use something like Valgrind to identify the leak? Also, can you check with master branch?
from log4cplus.
ok, maybe that is only short term solution
from log4cplus.
@hlee13 You said initially, it leaks under high pressure. What kind of pressure is it? Is it possible that, e.g., it is related to connection errors or disconnections?
from log4cplus.
yes, It is related to reconnection.
Both client and server have memory leak at a long term running. fd leaks is obvious.
from log4cplus.
@hlee13 TBH, I do not see the leak. I have used performance_test
against the loggingserver
and I do not see a leak of either FDs or memory. Maybe I am not producing the correct failure mode that triggers it. I do not know.
Which brings me to this: Are you sure your application is not dynamically creating too many loggers with SocketAppender
s? The number of loggers should be proportional to code complexity and/or number of modules of the code, and it should not depend on number server clients. E.g., for, say, network server application, you should not be creating separate logger for each client but you should use NDCContextCreator
to create NDC context with client identification/information.
from log4cplus.
can you provide loggingserver code, or loggingserver.cxx is same as https://github.com/log4cplus/log4cplus/blob/master/simpleserver/loggingserver.cxx ?
I found line 83 has new operator.
from log4cplus.
@hlee13 OK, I see the issue on the line now. I actually did not see it initially, because I have modified the loggingserver code to make testing easier.
from log4cplus.
how your testing easier code deal with the new operator in line 83
from log4cplus.
@hlee13 The loggingserver
leak should be fixed now on all branches since 1.1.x. Do you see any other leak?
from log4cplus.
There are no up date.
from log4cplus.
There are no up date.
I forgot to merge back the changes on 1.2.x branch to log4cplus/log4cplus repository. It is done now. I hope this is why you saw no updates.
from log4cplus.
I think this should be fixed now. If you think there are more problems, please either reopen this issue or create a new one.
from log4cplus.
Related Issues (20)
- Setting log level through env in log config file HOT 4
- Help needed: how to periodically flush logger with appender's immediateFlush set to false? HOT 2
- log file name not change after rollover TimeBasedRollingFileAppender HOT 3
- log's maxsize>200kb,but it dosen't work HOT 2
- Opentelemetry integration HOT 1
- What kind of compilation options can correctly generate a multi-threaded logging library HOT 5
- Win64 application crash on exit HOT 1
- Why mingw can't complie log4cplus-2.1.1? HOT 1
- Sending logs from log4cplus to log4j via TCP HOT 1
- Is it possible to build log4cplus for QNX aarch64le? HOT 3
- Save all configuration in a file HOT 2
- Question: Which latest version of Log4cplus I should use on RedHat 7.9 with DevToolset11-toolchain ( GCC 11.2 ) compiler HOT 7
- Does not work when maxBackupIndex is set to 0 HOT 1
- Include Headers Possibly Causing Build Error HOT 5
- how to set FD_CLOEXEC for log4cplus HOT 1
- Inconsistent Log File Permissions HOT 2
- Question: Which latest and stablest version of Log4cplus I should use on CentOS Linux 7 with GCC version 4.8.5 compiler HOT 1
- 'LOG4CXX_ASSERT' equivalent HOT 2
- Feature request: non-blocking logging with SyslogAppender HOT 6
- log4cplus doesn't compile with --enable-thread-pool=no and --enable-threads=no
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log4cplus.