linux - Log4cxx SocketAppender leads to application crash -
i using log4cxx , started working socketappender here 1. use following:
java org.apache.log4j.net.simplesocketserver 4712 log4j-server.properties
and able write logs on server. have local sizerollover policy setup. works fine, until stop running simplesockerserver. @ point c++ application crashes, think after reconnectiondelaytime specified in properties file.
0 0x0000003c5fa0e6fd in write () /lib64/libpthread.so.0
1 0x00007ffff79eade7 in apr_socket_send () /usr/lib64/libapr-1.so.0
2 0x00007ffff7d52bb1 in log4cxx::helpers::socket::write(log4cxx::helpers::bytebuffer&) () /usr/lib64/liblog4cxx.so.10
3 0x00007ffff7d595ed in log4cxx::helpers::socketoutputstream::flush(log4cxx::helpers::pool&) () /usr/lib64/liblog4cxx.so.10
4 0x00007ffff7d5468c in log4cxx::net::socketappender::append(log4cxx::helpers::objectptrt const&, log4cxx::helpers::pool&) () /usr/lib64/liblog4cxx.so.10
5 0x00007ffff7cd7d9d in log4cxx::appenderskeleton::doappend(log4cxx::helpers::objectptrt const&, log4cxx::helpers::pool&) () /usr/lib64/liblog4cxx.so.10
6 0x00007ffff7cd50f4 in log4cxx::helpers::appenderattachableimpl::appendlooponappenders(log4cxx::helpers::objectptrt const&, log4cxx::helpers::pool&) () /usr/lib64/liblog4cxx.so.10
7 0x00007ffff7d1adfd in log4cxx::logger::callappenders(log4cxx::helpers::objectptrt const&, log4cxx::helpers::pool&) const () /usr/lib64/liblog4cxx.so.10
8 0x00007ffff7d1c4ac in log4cxx::logger::forcedlog(log4cxx::helpers::objectptrt const&, std::basic_string, std::allocator > const&, log4cxx::spi::locationinfo const&) const () /usr/lib64/liblog4cxx.so.10`
my question is, possible make log4cxx write logs local file in case server stops? if start server again, before application crashes, socketappender not receive logs again. how can around problem? other suggestions send logs on network?
Comments
Post a Comment