log4cplus-devel Mailing List for log4cplus (Page 6)
Logging Framework for C++
Brought to you by:
wilx
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(3) |
Nov
(7) |
Dec
(15) |
2007 |
Jan
(19) |
Feb
(23) |
Mar
(40) |
Apr
(36) |
May
(18) |
Jun
(8) |
Jul
(10) |
Aug
(18) |
Sep
(18) |
Oct
(4) |
Nov
(1) |
Dec
(4) |
2008 |
Jan
(2) |
Feb
(1) |
Mar
(4) |
Apr
(16) |
May
(17) |
Jun
(15) |
Jul
(23) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(7) |
May
|
Jun
(5) |
Jul
(2) |
Aug
(9) |
Sep
|
Oct
(4) |
Nov
(6) |
Dec
(4) |
2010 |
Jan
(2) |
Feb
(2) |
Mar
(6) |
Apr
(5) |
May
(2) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
2011 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
(2) |
Jun
(11) |
Jul
(1) |
Aug
(4) |
Sep
(5) |
Oct
|
Nov
(4) |
Dec
|
2012 |
Jan
|
Feb
(13) |
Mar
(3) |
Apr
(5) |
May
(18) |
Jun
(22) |
Jul
(11) |
Aug
(25) |
Sep
(56) |
Oct
(1) |
Nov
(28) |
Dec
(3) |
2013 |
Jan
(66) |
Feb
(40) |
Mar
(61) |
Apr
(1) |
May
(45) |
Jun
(30) |
Jul
(30) |
Aug
(46) |
Sep
(23) |
Oct
(43) |
Nov
(95) |
Dec
(27) |
2014 |
Jan
(16) |
Feb
(19) |
Mar
(23) |
Apr
(18) |
May
(22) |
Jun
(12) |
Jul
(15) |
Aug
(16) |
Sep
(30) |
Oct
(10) |
Nov
(10) |
Dec
(5) |
2015 |
Jan
(2) |
Feb
(7) |
Mar
|
Apr
(1) |
May
(10) |
Jun
(3) |
Jul
(1) |
Aug
(5) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
(15) |
2016 |
Jan
(21) |
Feb
(6) |
Mar
(30) |
Apr
(12) |
May
(11) |
Jun
(4) |
Jul
(2) |
Aug
(7) |
Sep
(13) |
Oct
|
Nov
(6) |
Dec
(8) |
2017 |
Jan
(21) |
Feb
(5) |
Mar
(7) |
Apr
(3) |
May
|
Jun
(4) |
Jul
(18) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(4) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: Václav Z. <vha...@gm...> - 2014-03-27 14:16:10
|
On 14 March 2014 06:48, UK S wrote: > Dear All, > I am using log4cplus version log4cplus-1.1.2-rc2 . > I am facing a problem if I am using the LOG4CPLUS_TRACE then I am not > getting any traces out of it. I understand it should log function entry > and exit . > > Is there any issue or something I am missing ? > > Attached the simple program for the same. > > > #include "log4cplus/logger.h" > #include "log4cplus/consoleappender.h" > #include "log4cplus/loglevel.h" > #include <log4cplus/loggingmacros.h> > #include <iomanip> > > using namespace std; > using namespace log4cplus; > > int > main() > { > log4cplus::initialize (); > SharedAppenderPtr append_1(new ConsoleAppender()); > append_1->setName(LOG4CPLUS_TEXT("First")); > Logger::getRoot().addAppender(append_1); > > Logger root = Logger::getRoot(); > Logger test = Logger::getInstance(LOG4CPLUS_TEXT("test")); > > test.setLogLevel(NOT_SET_LOG_LEVEL); > LOG4CPLUS_TRACE(root, "ENTER"); > LOG4CPLUS_TRACE(test, "ENTER"); > LOG4CPLUS_INFO(test, "Hello UKS "); > > > return 0; > } > > *Output :-* > $./ostream_test > INFO - Hello UKS > The default threshold for root logger is DEBUG_LOG_LEVEL. You will have to set the threshold for the root logger to TRACE_LOG_LEVEL to get it to show. -- VZ |
From: Václav Z. <vha...@gm...> - 2014-03-19 21:08:48
|
Hi. I have released log4cplus 1.2.0-RC1. It is based on new 1.2.x branch. There are many visible and less visible changes relative to the code of 1.1.x branch. Here are some highlights: - TraceLogger and associated `LOG4CPLUS_TRACE_*()` macros now record function name in generated event. - Added Qt5 based `Qt5DebugAppender`. - Added prototype of Python bindings using Swig 2.0+. - Autotools based build system has been converted from `Makefile` per directory to single `Makefile` for the whole project mode. - Plain text documentation files have been converted to Markdown (with Pandoc's extensions). - `FileAppender` can now create missing directories in log file path, if this is enabled by `CreateDirs` property. - Added `MSTTSAppender` that uses Windows' text-to-speech engine. - `SysLogAppender` can now log into remote `syslog` instance using TCP in addition to previously supported UDP. - Added Autotest based testsuite running and verifying output of existing `tests/` directory tests. Improved tests coverage. - Many other small and bigger improvements. -- VZ |
From: Václav Z. <vha...@gm...> - 2014-03-19 20:26:14
|
Hi. I have released log4cplus 1.1.3-RC2. It contains only few changes: - Fixed bug #295 - infinite loop when underlying *printf() function returned EILSEQ. - Use PROJECT_SOURCE_DIR variable instead of CMAKE_SOURCE_DIR to allow using log4cplus as sub-project of another CMake project. -- VZ |
From: Andersen, J. B. (E W EN R&D DT ES 2 1)
<jes...@si...> - 2014-03-18 07:04:17
|
Hi, Thank you for your answer. Ok, it sounds likely that the QueueLimit is too low, I will try and raise it. There are multiple asyncAppenders defined in the configuration file, I forgot to mention that. I only posted the configuration for the one that was blocked. Jesper Andersen -----Original Message----- From: Václav Zeman [mailto:vha...@gm...] Sent: 17. marts 2014 15:34 To: Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) Cc: log...@li... Subject: Re: [Log4cplus-devel] Thread blocking when calling ev.gatherThreadSpecificData (); On 14 March 2014 14:09, Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) wrote: Thread 1428 is the blocking thread. When I click on the ::Queue::put_event in the calls stack Visual studio says that the next line in execution is: SemaphoreGuard semguard (sem); Maybe it is just waiting for the sem?? The QueueLimity property says how many events can be in the queue between the worker thread and other threads. Your configuration says it will be only 100. If you reach the limit, which is guarded by the semaphore, then the next put_event() will block on it. What I find confusing is that you have so many threads in Queue::get_events() even though your configuration shows only one AsyncAppender. 1844 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::ConfigurationWatchDogThread::run Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::ConfigurationWatchDogThread::run() Line 639 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 11340 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 5076 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 10480 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 7460 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 9384 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 1428 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::put_event Time Critical ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::put_event(const log4cplus::spi::InternalLoggingEvent & ev) Line 58 log4cplus.dll!log4cplus::AsyncAppender::append(const log4cplus::spi::InternalLoggingEvent & ev) Line 172 log4cplus.dll!log4cplus::Appender::doAppend(const log4cplus::spi::InternalLoggingEvent & event) Line 288 log4cplus.dll!log4cplus::spi::LoggerImpl::callAppenders(const log4cplus::spi::InternalLoggingEvent & event) Line 60 log4cplus.dll!log4cplus::detail::macro_forced_log(const log4cplus::Logger & logger, int log_level, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & msg, const char * filename, int line, const char * func) Line 86 MyApplication() winmm.dll!745d3af0() winmm.dll!745da535() winmm.dll!745da434() 9928 0 Worker Thread Win32 Thread log4cplus.dll!std::basic_filebuf<char,std::char_traits<char> >::overflow Normal ntdll.dll!7748fa12() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748fa12() log4cplus.dll!std::basic_filebuf<char,std::char_traits<char> >::overflow(int _Meta) Line 336 log4cplus.dll!std::operator<<<char,std::char_traits<char>,std::allocator<char> >(std::basic_ostream<char,std::char_traits<char> > & _Ostr, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Str) Line 518 log4cplus.dll!log4cplus::pattern::PatternConverter::formatAndAppend(std::basic_ostream<char,std::char_traits<char> > & output, const log4cplus::spi::InternalLoggingEvent & event) Line 370 log4cplus.dll!log4cplus::PatternLayout::formatAndAppend(std::basic_ostream<char,std::char_traits<char> > & output, const log4cplus::spi::InternalLoggingEvent & event) Line 1109 log4cplus.dll!log4cplus::FileAppender::append(const log4cplus::spi::InternalLoggingEvent & event) Line 372 log4cplus.dll!log4cplus::RollingFileAppender::append(const log4cplus::spi::InternalLoggingEvent & event) Line 504 log4cplus.dll!log4cplus::Appender::doAppend(const log4cplus::spi::InternalLoggingEvent & event) Line 288 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 77 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 3196 0 Worker Thread Win32 Thread log4cplus.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy(unsigned int _Newsize, unsigned int _Oldlen) Line 1932 ws2_32.dll!754b2f7d() ntdll.dll!7748fd81() ws2_32.dll!754b6958() ws2_32.dll!754b68cd() MyApplication() kernel32.dll!76cc339a() ——-Original Message——- From: Václav Zeman [mailto:vha...@gm...] Sent: 14. marts 2014 13:48 To: Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) Cc: log...@li... Subject: Re: [Log4cplus-devel] Thread blocking when calling ev.gatherThreadSpecificData (); On 14 March 2014 13:43, Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) wrote: Hi, Setup: log4cplus version 1.1.2.0. Compiled for Windows XP target platform Compiled using visual studio 2010 compiler as dynamic libraries. Logging is done from multiple threads. Loggers are configured with the AsyncAppender and a sub RollingFileAppender like this: ######################################################################## ## log file configuration (to disable, remove it from the rootLogger) ## ## log4cplus.appender.IRlogfile=log4cplus::AsyncAppender log4cplus.appender.IRlogfile.QueueLimit=100 log4cplus.appender.IRlogfile.Appender=log4cplus::RollingFileAppender log4cplus.appender.IRlogfile.Appender.layout=log4cplus::PatternLayout log4cplus.appender.IRlogfile.Appender.BufferSize=10000 log4cplus.appender.IRlogfile.Appender.ImmediateFlush=true ## ## The name and location for the log file log4cplus.appender.IRlogfile.Appender.File=d:/IRCore.log.txt ## ## The frequency at which log files will be rotated log4cplus.appender.IRlogfile.Appender.DatePattern='.'yyyy-MM-dd ## ## The maximum size of log files before they are rotated log4cplus.appender.IRlogfile.Appender.MaxFileSize=10MB ## ## The number of backup log files to keep log4cplus.appender.IRlogfile.Appender.MaxBackupIndex=10 ## ## pattern used for the log file log4cplus.appender.IRlogfile.Appender.layout.ConversionPattern=%D{%Y-%m-%d %H:%M:%S.%q};%c;%m%n I have experienced one of my threads blocked for aprox. 1500 ms. This triggered my watchdog thread to write a minidump file. This mini dump indicated that the blocking thread was located somewhere in the ev.gatherThreadSpecificData() method. Maybe my configuration is faulted? From the source I can see it must have been in one of the these methods the block occured: getNDC (); getMDCCopy (); getThread (); getThread2 (); Can anybody see / explain why a block can occur? I have no explanation. Could you post the tail of the thread stack? ________________________________ VZ |
From: Václav Z. <vha...@gm...> - 2014-03-17 14:33:52
|
On 14 March 2014 14:09, Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) wrote: Thread 1428 is the blocking thread. When I click on the ::Queue::put_event in the calls stack Visual studio says that the next line in execution is: SemaphoreGuard semguard (sem); Maybe it is just waiting for the sem?? The QueueLimity property says how many events can be in the queue between the worker thread and other threads. Your configuration says it will be only 100. If you reach the limit, which is guarded by the semaphore, then the next put_event() will block on it. What I find confusing is that you have so many threads in Queue::get_events() even though your configuration shows only one AsyncAppender. 1844 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::ConfigurationWatchDogThread::run Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::ConfigurationWatchDogThread::run() Line 639 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 11340 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 5076 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 10480 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 7460 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 9384 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 1428 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::put_event Time Critical ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::put_event(const log4cplus::spi::InternalLoggingEvent & ev) Line 58 log4cplus.dll!log4cplus::AsyncAppender::append(const log4cplus::spi::InternalLoggingEvent & ev) Line 172 log4cplus.dll!log4cplus::Appender::doAppend(const log4cplus::spi::InternalLoggingEvent & event) Line 288 log4cplus.dll!log4cplus::spi::LoggerImpl::callAppenders(const log4cplus::spi::InternalLoggingEvent & event) Line 60 log4cplus.dll!log4cplus::detail::macro_forced_log(const log4cplus::Logger & logger, int log_level, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & msg, const char * filename, int line, const char * func) Line 86 MyApplication() winmm.dll!745d3af0() winmm.dll!745da535() winmm.dll!745da434() 9928 0 Worker Thread Win32 Thread log4cplus.dll!std::basic_filebuf<char,std::char_traits<char> >::overflow Normal ntdll.dll!7748fa12() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748fa12() log4cplus.dll!std::basic_filebuf<char,std::char_traits<char> >::overflow(int _Meta) Line 336 log4cplus.dll!std::operator<<<char,std::char_traits<char>,std::allocator<char> >(std::basic_ostream<char,std::char_traits<char> > & _Ostr, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Str) Line 518 log4cplus.dll!log4cplus::pattern::PatternConverter::formatAndAppend(std::basic_ostream<char,std::char_traits<char> > & output, const log4cplus::spi::InternalLoggingEvent & event) Line 370 log4cplus.dll!log4cplus::PatternLayout::formatAndAppend(std::basic_ostream<char,std::char_traits<char> > & output, const log4cplus::spi::InternalLoggingEvent & event) Line 1109 log4cplus.dll!log4cplus::FileAppender::append(const log4cplus::spi::InternalLoggingEvent & event) Line 372 log4cplus.dll!log4cplus::RollingFileAppender::append(const log4cplus::spi::InternalLoggingEvent & event) Line 504 log4cplus.dll!log4cplus::Appender::doAppend(const log4cplus::spi::InternalLoggingEvent & event) Line 288 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 77 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 3196 0 Worker Thread Win32 Thread log4cplus.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy(unsigned int _Newsize, unsigned int _Oldlen) Line 1932 ws2_32.dll!754b2f7d() ntdll.dll!7748fd81() ws2_32.dll!754b6958() ws2_32.dll!754b68cd() MyApplication() kernel32.dll!76cc339a() ——-Original Message——- From: Václav Zeman [mailto:vha...@gm...] Sent: 14. marts 2014 13:48 To: Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) Cc: log...@li... Subject: Re: [Log4cplus-devel] Thread blocking when calling ev.gatherThreadSpecificData (); On 14 March 2014 13:43, Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) wrote: Hi, Setup: log4cplus version 1.1.2.0. Compiled for Windows XP target platform Compiled using visual studio 2010 compiler as dynamic libraries. Logging is done from multiple threads. Loggers are configured with the AsyncAppender and a sub RollingFileAppender like this: ######################################################################## ## log file configuration (to disable, remove it from the rootLogger) ## ## log4cplus.appender.IRlogfile=log4cplus::AsyncAppender log4cplus.appender.IRlogfile.QueueLimit=100 log4cplus.appender.IRlogfile.Appender=log4cplus::RollingFileAppender log4cplus.appender.IRlogfile.Appender.layout=log4cplus::PatternLayout log4cplus.appender.IRlogfile.Appender.BufferSize=10000 log4cplus.appender.IRlogfile.Appender.ImmediateFlush=true ## ## The name and location for the log file log4cplus.appender.IRlogfile.Appender.File=d:/IRCore.log.txt ## ## The frequency at which log files will be rotated log4cplus.appender.IRlogfile.Appender.DatePattern='.'yyyy-MM-dd ## ## The maximum size of log files before they are rotated log4cplus.appender.IRlogfile.Appender.MaxFileSize=10MB ## ## The number of backup log files to keep log4cplus.appender.IRlogfile.Appender.MaxBackupIndex=10 ## ## pattern used for the log file log4cplus.appender.IRlogfile.Appender.layout.ConversionPattern=%D{%Y-%m-%d %H:%M:%S.%q};%c;%m%n I have experienced one of my threads blocked for aprox. 1500 ms. This triggered my watchdog thread to write a minidump file. This mini dump indicated that the blocking thread was located somewhere in the ev.gatherThreadSpecificData() method. Maybe my configuration is faulted? >From the source I can see it must have been in one of the these methods the block occured: getNDC (); getMDCCopy (); getThread (); getThread2 (); Can anybody see / explain why a block can occur? I have no explanation. Could you post the tail of the thread stack? ________________________________ VZ |
From: Andersen, J. B. (E W EN R&D DT ES 2 1)
<jes...@si...> - 2014-03-14 13:09:38
|
Thread 1428 is the blocking thread. When I click on the ::Queue::put_event in the calls stack Visual studio says that the next line in execution is: SemaphoreGuard semguard (sem); Maybe it is just waiting for the sem?? 1844 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::ConfigurationWatchDogThread::run Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::ConfigurationWatchDogThread::run() Line 639 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 11340 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 5076 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 10480 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 7460 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 9384 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::get_events Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::get_events(std::deque<log4cplus::spi::InternalLoggingEvent,std::allocator<log4cplus::spi::InternalLoggingEvent> > * buf) Line 171 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 71 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 1428 0 Worker Thread Win32 Thread log4cplus.dll!log4cplus::thread::Queue::put_event Time Critical ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!log4cplus::thread::Queue::put_event(const log4cplus::spi::InternalLoggingEvent & ev) Line 58 log4cplus.dll!log4cplus::AsyncAppender::append(const log4cplus::spi::InternalLoggingEvent & ev) Line 172 log4cplus.dll!log4cplus::Appender::doAppend(const log4cplus::spi::InternalLoggingEvent & event) Line 288 log4cplus.dll!log4cplus::spi::LoggerImpl::callAppenders(const log4cplus::spi::InternalLoggingEvent & event) Line 60 log4cplus.dll!log4cplus::detail::macro_forced_log(const log4cplus::Logger & logger, int log_level, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & msg, const char * filename, int line, const char * func) Line 86 MyApplication() winmm.dll!745d3af0() winmm.dll!745da535() winmm.dll!745da434() 9928 0 Worker Thread Win32 Thread log4cplus.dll!std::basic_filebuf<char,std::char_traits<char> >::overflow Normal ntdll.dll!7748fa12() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748fa12() log4cplus.dll!std::basic_filebuf<char,std::char_traits<char> >::overflow(int _Meta) Line 336 log4cplus.dll!std::operator<<<char,std::char_traits<char>,std::allocator<char> >(std::basic_ostream<char,std::char_traits<char> > & _Ostr, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Str) Line 518 log4cplus.dll!log4cplus::pattern::PatternConverter::formatAndAppend(std::basic_ostream<char,std::char_traits<char> > & output, const log4cplus::spi::InternalLoggingEvent & event) Line 370 log4cplus.dll!log4cplus::PatternLayout::formatAndAppend(std::basic_ostream<char,std::char_traits<char> > & output, const log4cplus::spi::InternalLoggingEvent & event) Line 1109 log4cplus.dll!log4cplus::FileAppender::append(const log4cplus::spi::InternalLoggingEvent & event) Line 372 log4cplus.dll!log4cplus::RollingFileAppender::append(const log4cplus::spi::InternalLoggingEvent & event) Line 504 log4cplus.dll!log4cplus::Appender::doAppend(const log4cplus::spi::InternalLoggingEvent & event) Line 288 log4cplus.dll!log4cplus::`anonymous namespace'::QueueThread::run() Line 77 log4cplus.dll!log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void * arg) Line 216 log4cplus.dll!`anonymous namespace'::threadStartFunc(void * param) Line 185 3196 0 Worker Thread Win32 Thread log4cplus.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy Normal ntdll.dll!7748f8c1() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7748f8c1() log4cplus.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy(unsigned int _Newsize, unsigned int _Oldlen) Line 1932 ws2_32.dll!754b2f7d() ntdll.dll!7748fd81() ws2_32.dll!754b6958() ws2_32.dll!754b68cd() MyApplication() kernel32.dll!76cc339a() -----Original Message----- From: Václav Zeman [mailto:vha...@gm...] Sent: 14. marts 2014 13:48 To: Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) Cc: log...@li... Subject: Re: [Log4cplus-devel] Thread blocking when calling ev.gatherThreadSpecificData (); On 14 March 2014 13:43, Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) wrote: > Hi, > > Setup: > log4cplus version 1.1.2.0. > Compiled for Windows XP target platform > Compiled using visual studio 2010 compiler as dynamic libraries. > Logging is done from multiple threads. > > Loggers are configured with the AsyncAppender and a sub RollingFileAppender > like this: > ######################################################################## > ## log file configuration (to disable, remove it from the rootLogger) ## > ## > log4cplus.appender.IRlogfile=log4cplus::AsyncAppender > log4cplus.appender.IRlogfile.QueueLimit=100 > > log4cplus.appender.IRlogfile.Appender=log4cplus::RollingFileAppender > log4cplus.appender.IRlogfile.Appender.layout=log4cplus::PatternLayout > log4cplus.appender.IRlogfile.Appender.BufferSize=10000 > log4cplus.appender.IRlogfile.Appender.ImmediateFlush=true > ## > ## The name and location for the log file > log4cplus.appender.IRlogfile.Appender.File=d:/IRCore.log.txt > ## > ## The frequency at which log files will be rotated > log4cplus.appender.IRlogfile.Appender.DatePattern='.'yyyy-MM-dd > ## > ## The maximum size of log files before they are rotated > log4cplus.appender.IRlogfile.Appender.MaxFileSize=10MB > ## > ## The number of backup log files to keep > log4cplus.appender.IRlogfile.Appender.MaxBackupIndex=10 > ## > ## pattern used for the log file > log4cplus.appender.IRlogfile.Appender.layout.ConversionPattern=%D{%Y-%m-%d > %H:%M:%S.%q};%c;%m%n > > > I have experienced one of my threads blocked for aprox. 1500 ms. > This triggered my watchdog thread to write a minidump file. This mini dump > indicated that the blocking thread was located somewhere in the > ev.gatherThreadSpecificData() method. > > Maybe my configuration is faulted? > > From the source I can see it must have been in one of the these methods the > block occured: > > getNDC (); > getMDCCopy (); > getThread (); > getThread2 (); > > Can anybody see / explain why a block can occur? I have no explanation. Could you post the tail of the thread stack? -- VZ |
From: Václav Z. <vha...@gm...> - 2014-03-14 12:48:15
|
On 14 March 2014 13:43, Andersen, Jesper Behrens (E W EN R&D DT ES 2 1) wrote: > Hi, > > Setup: > log4cplus version 1.1.2.0. > Compiled for Windows XP target platform > Compiled using visual studio 2010 compiler as dynamic libraries. > Logging is done from multiple threads. > > Loggers are configured with the AsyncAppender and a sub RollingFileAppender > like this: > ######################################################################## > ## log file configuration (to disable, remove it from the rootLogger) ## > ## > log4cplus.appender.IRlogfile=log4cplus::AsyncAppender > log4cplus.appender.IRlogfile.QueueLimit=100 > > log4cplus.appender.IRlogfile.Appender=log4cplus::RollingFileAppender > log4cplus.appender.IRlogfile.Appender.layout=log4cplus::PatternLayout > log4cplus.appender.IRlogfile.Appender.BufferSize=10000 > log4cplus.appender.IRlogfile.Appender.ImmediateFlush=true > ## > ## The name and location for the log file > log4cplus.appender.IRlogfile.Appender.File=d:/IRCore.log.txt > ## > ## The frequency at which log files will be rotated > log4cplus.appender.IRlogfile.Appender.DatePattern='.'yyyy-MM-dd > ## > ## The maximum size of log files before they are rotated > log4cplus.appender.IRlogfile.Appender.MaxFileSize=10MB > ## > ## The number of backup log files to keep > log4cplus.appender.IRlogfile.Appender.MaxBackupIndex=10 > ## > ## pattern used for the log file > log4cplus.appender.IRlogfile.Appender.layout.ConversionPattern=%D{%Y-%m-%d > %H:%M:%S.%q};%c;%m%n > > > I have experienced one of my threads blocked for aprox. 1500 ms. > This triggered my watchdog thread to write a minidump file. This mini dump > indicated that the blocking thread was located somewhere in the > ev.gatherThreadSpecificData() method. > > Maybe my configuration is faulted? > > From the source I can see it must have been in one of the these methods the > block occured: > > getNDC (); > getMDCCopy (); > getThread (); > getThread2 (); > > Can anybody see / explain why a block can occur? I have no explanation. Could you post the tail of the thread stack? -- VZ |
From: Andersen, J. B. (E W EN R&D DT ES 2 1)
<jes...@si...> - 2014-03-14 12:43:32
|
Hi, Setup: log4cplus version 1.1.2.0. Compiled for Windows XP target platform Compiled using visual studio 2010 compiler as dynamic libraries. Logging is done from multiple threads. Loggers are configured with the AsyncAppender and a sub RollingFileAppender like this: ######################################################################## ## log file configuration (to disable, remove it from the rootLogger) ## ## log4cplus.appender.IRlogfile=log4cplus::AsyncAppender log4cplus.appender.IRlogfile.QueueLimit=100 log4cplus.appender.IRlogfile.Appender=log4cplus::RollingFileAppender log4cplus.appender.IRlogfile.Appender.layout=log4cplus::PatternLayout log4cplus.appender.IRlogfile.Appender.BufferSize=10000 log4cplus.appender.IRlogfile.Appender.ImmediateFlush=true ## ## The name and location for the log file log4cplus.appender.IRlogfile.Appender.File=d:/IRCore.log.txt ## ## The frequency at which log files will be rotated log4cplus.appender.IRlogfile.Appender.DatePattern='.'yyyy-MM-dd ## ## The maximum size of log files before they are rotated log4cplus.appender.IRlogfile.Appender.MaxFileSize=10MB ## ## The number of backup log files to keep log4cplus.appender.IRlogfile.Appender.MaxBackupIndex=10 ## ## pattern used for the log file log4cplus.appender.IRlogfile.Appender.layout.ConversionPattern=%D{%Y-%m-%d %H:%M:%S.%q};%c;%m%n I have experienced one of my threads blocked for aprox. 1500 ms. This triggered my watchdog thread to write a minidump file. This mini dump indicated that the blocking thread was located somewhere in the ev.gatherThreadSpecificData() method. Maybe my configuration is faulted? >From the source I can see it must have been in one of the these methods the block occured: getNDC (); getMDCCopy (); getThread (); getThread2 (); Can anybody see / explain why a block can occur? Kind regards Jesper |
From: UK S <uk...@te...> - 2014-03-14 06:01:27
|
Dear All,I am using log4cplus version log4cplus-1.1.2-rc2 .I am facing a problem if I am using the LOG4CPLUS_TRACE then I am not getting any traces out of it. I understand it should log function entry and exit . Is there any issue or something I am missing ? Attached the simple program for the same. #include "log4cplus/logger.h"#include "log4cplus/consoleappender.h"#include "log4cplus/loglevel.h"#include <log4cplus/loggingmacros.h>#include <iomanip> using namespace std;using namespace log4cplus; intmain(){ log4cplus::initialize (); SharedAppenderPtr append_1(new ConsoleAppender()); append_1->setName(LOG4CPLUS_TEXT("First")); Logger::getRoot().addAppender(append_1); Logger root = Logger::getRoot(); Logger test = Logger::getInstance(LOG4CPLUS_TEXT("test")); test.setLogLevel(NOT_SET_LOG_LEVEL); LOG4CPLUS_TRACE(root, "ENTER"); LOG4CPLUS_TRACE(test, "ENTER"); LOG4CPLUS_INFO(test, "Hello UKS "); return 0;} Output :-$./ostream_test INFO - Hello UKS |
From: Václav Z. <vha...@gm...> - 2014-03-11 17:33:54
|
On 03/11/2014 11:06 AM, Markus von Arx wrote: > Hi > > Is there a reason why the AsyncAppender properties constructor > [AsyncAppender::AsyncAppender (helpers::Properties const & props)] does > not call the base class properties constructor? I see that there is some > tuff in the Appender base class properties constructor (e.g. the > "layout" property) that is unnecessary for the AsyncAppender, but other > stuff (e.g. "filters." and "Threshold") would also make sense for the > AsyncAppender. > > I'm asking because this is why AsyncAppender does not support the > Threshold configuration attribute. I think supporting thresholds (and > also filters) would be very useful for the AsyncAppender because it > could greatly reduce the number of log messages that are passed through > the QueueThread if the AsyncAppender could discard most messages directly. > > If this is not intentional, I'd like to ask for a patch/bugfix to enable > Threshold configuration for the AsyncAppender. > > Btw: I patched AsyncAppender myself to add Threshold support. Because I > don't know why AsyncAppender properties constructor does not call the > base class properties constructor, I added my code at the end of the > AsyncAppender properties constructor, just before the call to > [init_queue_thread (queue_len);]. I basically copy-pasted code from the > Appender base class. Work's fine. Here's my code in case you find it useful: > > if (props.exists(LOG4CPLUS_TEXT("Threshold"))) { > tstring tmp = props.getProperty(LOG4CPLUS_TEXT("Threshold")); > tmp = log4cplus::helpers::toUpper(tmp); > threshold = log4cplus::getLogLevelManager().fromString(tmp); > } I guess threshold processing could be useful. Feel free to create a bug report to remind me or send a patch. -- VZ |
From: Markus v. A. <mkv...@gm...> - 2014-03-11 10:06:17
|
Hi Is there a reason why the AsyncAppender properties constructor [AsyncAppender::AsyncAppender (helpers::Properties const & props)] does not call the base class properties constructor? I see that there is some tuff in the Appender base class properties constructor (e.g. the "layout" property) that is unnecessary for the AsyncAppender, but other stuff (e.g. "filters." and "Threshold") would also make sense for the AsyncAppender. I'm asking because this is why AsyncAppender does not support the Threshold configuration attribute. I think supporting thresholds (and also filters) would be very useful for the AsyncAppender because it could greatly reduce the number of log messages that are passed through the QueueThread if the AsyncAppender could discard most messages directly. If this is not intentional, I'd like to ask for a patch/bugfix to enable Threshold configuration for the AsyncAppender. Btw: I patched AsyncAppender myself to add Threshold support. Because I don't know why AsyncAppender properties constructor does not call the base class properties constructor, I added my code at the end of the AsyncAppender properties constructor, just before the call to [init_queue_thread (queue_len);]. I basically copy-pasted code from the Appender base class. Work's fine. Here's my code in case you find it useful: if (props.exists(LOG4CPLUS_TEXT("Threshold"))) { tstring tmp = props.getProperty(LOG4CPLUS_TEXT("Threshold")); tmp = log4cplus::helpers::toUpper(tmp); threshold = log4cplus::getLogLevelManager().fromString(tmp); } Thanks, Markus |
From: drkmkzs <dr...@gm...> - 2014-03-06 12:58:05
|
Oh yes my bad, I didn't realize the .hxx was generated into build and not into the include src (which sounds logical after all :)) Indeed I don't know about the install process since I like to use "external libraries" from where they've been compiled (yes I know, not always very smart) Thanx for answer, sorry again :) 2014-03-06 13:23 GMT+01:00 Václav Zeman <vha...@gm...>: > On 5 March 2014 16:13, drkmkzs wrote: > > > > Hello, > > > > I've just been using log4cplus in windows, is really cool :) > > > > Now i'm using it on linux, I had no problem to compile it. But when > using it > > in my project, i had some problem with a missin defines.hxx (I only made > > cmake .. without any specific options) > > > > In file included from > > > /local/DEV/Projects/drk/common/../external/log4cplus/include/log4cplus/helpers/loglog.h:27:0, > > from > /local/DEV/Projects/drk/common/utils/glibmm/Log.h:40, > > from > > /local/DEV/Projects/drk/common/utils/glibmm/globals.h:42, > > from > > /local/DEV/Projects/drk/common/utils/glibmm/trace.cpp:8: > > > /local/DEV/Projects/drk/common/../external/log4cplus/include/log4cplus/config.hxx:32:42: > > erreur fatale: log4cplus/config/defines.hxx : Aucun fichier ou dossier > de ce > > type > > # include <log4cplus/config/defines.hxx> > > The defines.hxx files is generated by the build process. Does CMake > not install it if you do the install step? Either way, you should find > it somewhere in the build tree. > > > > > I had read similar bug, but on log4cplus compilation, not for log4cplus > > usage, so I prefer to ask here instead of posting a bug that could be a > > misuage only :) > > (https://sourceforge.net/p/log4cplus/bugs/122/) > > > > But as in the 122 bug, a configure in log4cplus sources solves the > problem > > :) > > -- > VZ > |
From: Václav Z. <vha...@gm...> - 2014-03-06 12:23:23
|
On 5 March 2014 16:13, drkmkzs wrote: > > Hello, > > I've just been using log4cplus in windows, is really cool :) > > Now i'm using it on linux, I had no problem to compile it. But when using it > in my project, i had some problem with a missin defines.hxx (I only made > cmake .. without any specific options) > > In file included from > /local/DEV/Projects/drk/common/../external/log4cplus/include/log4cplus/helpers/loglog.h:27:0, > from /local/DEV/Projects/drk/common/utils/glibmm/Log.h:40, > from > /local/DEV/Projects/drk/common/utils/glibmm/globals.h:42, > from > /local/DEV/Projects/drk/common/utils/glibmm/trace.cpp:8: > /local/DEV/Projects/drk/common/../external/log4cplus/include/log4cplus/config.hxx:32:42: > erreur fatale: log4cplus/config/defines.hxx : Aucun fichier ou dossier de ce > type > # include <log4cplus/config/defines.hxx> The defines.hxx files is generated by the build process. Does CMake not install it if you do the install step? Either way, you should find it somewhere in the build tree. > > I had read similar bug, but on log4cplus compilation, not for log4cplus > usage, so I prefer to ask here instead of posting a bug that could be a > misuage only :) > (https://sourceforge.net/p/log4cplus/bugs/122/) > > But as in the 122 bug, a configure in log4cplus sources solves the problem > :) -- VZ |
From: drkmkzs <dr...@gm...> - 2014-03-05 15:13:24
|
Hello, I've just been using log4cplus in windows, is really cool :) Now i'm using it on linux, I had no problem to compile it. But when using it in my project, i had some problem with a missin defines.hxx (I only made cmake .. without any specific options) In file included from /local/DEV/Projects/drk/common/../external/log4cplus/include/log4cplus/helpers/loglog.h:27:0, from /local/DEV/Projects/drk/common/utils/glibmm/Log.h:40, from /local/DEV/Projects/drk/common/utils/glibmm/globals.h:42, from /local/DEV/Projects/drk/common/utils/glibmm/trace.cpp:8: /local/DEV/Projects/drk/common/../external/log4cplus/include/log4cplus/config.hxx:32:42: erreur fatale: log4cplus/config/defines.hxx : Aucun fichier ou dossier de ce type # include <log4cplus/config/defines.hxx> I had read similar bug, but on log4cplus compilation, not for log4cplus usage, so I prefer to ask here instead of posting a bug that could be a misuage only :) (https://sourceforge.net/p/log4cplus/bugs/122/) But as in the 122 bug, a configure in log4cplus sources solves the problem :) |
From: drkmkzs <dr...@gm...> - 2014-03-05 15:06:39
|
ok, thanks for precision :) 2014-03-03 23:06 GMT+01:00 Václav Zeman <vha...@gm...>: > On 03/03/2014 05:59 PM, drkmkzs wrote: > > Thank for help, > > > > But i was explicitely linking with lib4cplusU DLL when linking my > > application with my static lib. > > > > Indeed my error was to forget to add some cmake definition for unicode > > in my cmake, as in the examples... > > > > So after that, it was ok except my app didn't compile, when logging some > > trace using glibmm methods... > > > > So for the moment, I have recompiled log4cplus without unicode support, > > removed the definitions in my cmake, and all compile well (except for > > some bad things from my side). What is the unicode option for ? I guess > > to treat specific type as unicode compliant types ? > > The Unicode option serves the same purpose as the UNICODE (and _UNICODE) > preprocessor symbols do in Windows headers. They switch between char and > wchar_t in the API. When it is not defined, all the interfaces take > chars and std::strings. When it is defined, all the interfaces take > wchar_ts and std::wstrings. > > > > > > > 2014-02-28 19:36 GMT+01:00 Václav Zeman <vha...@gm... > > <mailto:vha...@gm...>>: > > > > On 02/28/2014 06:42 PM, drkmkzs wrote: > > > Hello, > > > > > > I'm trying to use log4cplus on windows7, with MinGW, but I am > > > expericencing some problems ... > > > > > > I tried the 1.1.3-rc1 and 1.1.2, it has the same behaviour. > > > > > > Compilation of log4cplus is OK with Cmake, i have my > > > liblog4cplusU.dll, so far, cool :) > > > > > > In my app i create a static lib that links to the > liblog4cplusU.dll, > > > it's ok. > > > > > > But when my exe tries to link with my static library, i have some > > > error "undefined reference to > > > `_imp___ZN9log4cplus6Logger11getInstanceERKSs'" I have checked that > > > my CmakeList of my exe has correct link and libraries directory > > > specified ... > > > > > > I have read some thread : > > > > > > http://stackoverflow.com/questions/2848556/c-project-compiles-as-static-lib-fails-linker-error-as-dynamic-lib-why > > > > > > I tried to add definitions in my Cmake ( LOG4CPLUS_BUILD_DLL, > > > log4cplus_EXPORTS, DLL_EXPORT) , but it didn't change anything .... > > > > > > Am I missing anything ? > > > > I suspect that when you are linking your static library to your > > executable, it does not pull in the dependency on the log4cplus DLL > > import library. Try linking your executable specifically to > > liblog4cplusU.a, or whatever is the correct log4cplus DLL import > library > > file name. > > -- > VZ > > > > > ------------------------------------------------------------------------------ > Subversion Kills Productivity. Get off Subversion & Make the Move to > Perforce. > With Perforce, you get hassle-free workflows. Merge that actually works. > Faster operations. Version large binaries. Built-in WAN optimization and > the > freedom to use Git, Perforce or both. Make the move to Perforce. > > http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk > _______________________________________________ > Log4cplus-devel mailing list > Log...@li... > https://lists.sourceforge.net/lists/listinfo/log4cplus-devel > > |
From: Václav Z. <vha...@gm...> - 2014-03-03 22:06:35
|
On 03/03/2014 05:59 PM, drkmkzs wrote: > Thank for help, > > But i was explicitely linking with lib4cplusU DLL when linking my > application with my static lib. > > Indeed my error was to forget to add some cmake definition for unicode > in my cmake, as in the examples... > > So after that, it was ok except my app didn't compile, when logging some > trace using glibmm methods... > > So for the moment, I have recompiled log4cplus without unicode support, > removed the definitions in my cmake, and all compile well (except for > some bad things from my side). What is the unicode option for ? I guess > to treat specific type as unicode compliant types ? The Unicode option serves the same purpose as the UNICODE (and _UNICODE) preprocessor symbols do in Windows headers. They switch between char and wchar_t in the API. When it is not defined, all the interfaces take chars and std::strings. When it is defined, all the interfaces take wchar_ts and std::wstrings. > > > 2014-02-28 19:36 GMT+01:00 Václav Zeman <vha...@gm... > <mailto:vha...@gm...>>: > > On 02/28/2014 06:42 PM, drkmkzs wrote: > > Hello, > > > > I'm trying to use log4cplus on windows7, with MinGW, but I am > > expericencing some problems ... > > > > I tried the 1.1.3-rc1 and 1.1.2, it has the same behaviour. > > > > Compilation of log4cplus is OK with Cmake, i have my > > liblog4cplusU.dll, so far, cool :) > > > > In my app i create a static lib that links to the liblog4cplusU.dll, > > it's ok. > > > > But when my exe tries to link with my static library, i have some > > error "undefined reference to > > `_imp___ZN9log4cplus6Logger11getInstanceERKSs'" I have checked that > > my CmakeList of my exe has correct link and libraries directory > > specified ... > > > > I have read some thread : > > > http://stackoverflow.com/questions/2848556/c-project-compiles-as-static-lib-fails-linker-error-as-dynamic-lib-why > > > > I tried to add definitions in my Cmake ( LOG4CPLUS_BUILD_DLL, > > log4cplus_EXPORTS, DLL_EXPORT) , but it didn't change anything .... > > > > Am I missing anything ? > > I suspect that when you are linking your static library to your > executable, it does not pull in the dependency on the log4cplus DLL > import library. Try linking your executable specifically to > liblog4cplusU.a, or whatever is the correct log4cplus DLL import library > file name. -- VZ |
From: drkmkzs <dr...@gm...> - 2014-03-03 16:59:41
|
Thank for help, But i was explicitely linking with lib4cplusU DLL when linking my application with my static lib. Indeed my error was to forget to add some cmake definition for unicode in my cmake, as in the examples... So after that, it was ok except my app didn't compile, when logging some trace using glibmm methods... So for the moment, I have recompiled log4cplus without unicode support, removed the definitions in my cmake, and all compile well (except for some bad things from my side). What is the unicode option for ? I guess to treat specific type as unicode compliant types ? 2014-02-28 19:36 GMT+01:00 Václav Zeman <vha...@gm...>: > On 02/28/2014 06:42 PM, drkmkzs wrote: > > Hello, > > > > I'm trying to use log4cplus on windows7, with MinGW, but I am > > expericencing some problems ... > > > > I tried the 1.1.3-rc1 and 1.1.2, it has the same behaviour. > > > > Compilation of log4cplus is OK with Cmake, i have my > > liblog4cplusU.dll, so far, cool :) > > > > In my app i create a static lib that links to the liblog4cplusU.dll, > > it's ok. > > > > But when my exe tries to link with my static library, i have some > > error "undefined reference to > > `_imp___ZN9log4cplus6Logger11getInstanceERKSs'" I have checked that > > my CmakeList of my exe has correct link and libraries directory > > specified ... > > > > I have read some thread : > > > http://stackoverflow.com/questions/2848556/c-project-compiles-as-static-lib-fails-linker-error-as-dynamic-lib-why > > > > I tried to add definitions in my Cmake ( LOG4CPLUS_BUILD_DLL, > > log4cplus_EXPORTS, DLL_EXPORT) , but it didn't change anything .... > > > > Am I missing anything ? > > I suspect that when you are linking your static library to your > executable, it does not pull in the dependency on the log4cplus DLL > import library. Try linking your executable specifically to > liblog4cplusU.a, or whatever is the correct log4cplus DLL import library > file name. > > -- > VZ > > > > > > ------------------------------------------------------------------------------ > Flow-based real-time traffic analytics software. Cisco certified tool. > Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer > Customize your own dashboards, set traffic alerts and generate reports. > Network behavioral analysis & security monitoring. All-in-one tool. > > http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk > _______________________________________________ > Log4cplus-devel mailing list > Log...@li... > https://lists.sourceforge.net/lists/listinfo/log4cplus-devel > > |
From: Václav Z. <vha...@gm...> - 2014-02-28 18:36:53
|
On 02/28/2014 06:42 PM, drkmkzs wrote: > Hello, > > I'm trying to use log4cplus on windows7, with MinGW, but I am > expericencing some problems ... > > I tried the 1.1.3-rc1 and 1.1.2, it has the same behaviour. > > Compilation of log4cplus is OK with Cmake, i have my > liblog4cplusU.dll, so far, cool :) > > In my app i create a static lib that links to the liblog4cplusU.dll, > it's ok. > > But when my exe tries to link with my static library, i have some > error "undefined reference to > `_imp___ZN9log4cplus6Logger11getInstanceERKSs'" I have checked that > my CmakeList of my exe has correct link and libraries directory > specified ... > > I have read some thread : > http://stackoverflow.com/questions/2848556/c-project-compiles-as-static-lib-fails-linker-error-as-dynamic-lib-why > > I tried to add definitions in my Cmake ( LOG4CPLUS_BUILD_DLL, > log4cplus_EXPORTS, DLL_EXPORT) , but it didn't change anything .... > > Am I missing anything ? I suspect that when you are linking your static library to your executable, it does not pull in the dependency on the log4cplus DLL import library. Try linking your executable specifically to liblog4cplusU.a, or whatever is the correct log4cplus DLL import library file name. -- VZ |
From: drkmkzs <dr...@gm...> - 2014-02-28 17:42:39
|
Hello, I'm trying to use log4cplus on windows7, with MinGW, but I am expericencing some problems ... I tried the 1.1.3-rc1 and 1.1.2, it has the same behaviour. Compilation of log4cplus is OK with Cmake, i have my liblog4cplusU.dll, so far, cool :) In my app i create a static lib that links to the liblog4cplusU.dll, it's ok. But when my exe tries to link with my static library, i have some error "undefined reference to `_imp___ZN9log4cplus6Logger11getInstanceERKSs'" I have checked that my CmakeList of my exe has correct link and libraries directory specified ... I have read some thread : http://stackoverflow.com/questions/2848556/c-project-compiles-as-static-lib-fails-linker-error-as-dynamic-lib-why I tried to add definitions in my Cmake ( LOG4CPLUS_BUILD_DLL, log4cplus_EXPORTS, DLL_EXPORT) , but it didn't change anything .... Am I missing anything ? Thanx a lot :) |
From: Václav Z. <vha...@gm...> - 2014-01-29 22:36:07
|
On 01/29/2014 07:20 PM, Steve Hartmann wrote: > > > On 1/29/14 3:38 AM, "Václav Zeman" <vha...@gm...> wrote: > >> It seems to me that layout would be a better place for this. >> >> Is there a prior art for this feature in log4j (or any other Java >> logging library) or log4net, etc.? We could copy their design >> decisions / interfaces. >> > > With log4j, you have to extend the layout. Here is a link to an article > on how to use it: > http://www.coderanch.com/t/535099/oa/Inserting-Header-Text-Log-file > > Personally, I would like to just have it built in as a property - what do > you think? > Yeah, I do not think that having to derive own layout is the way to go. It should be built-in. I am not sure if it should be in PatternLayout (and TTCCLayout) only or if it should be part of the base Layout class; Adding the header information to a new base class, that would be between Layout and PatternLayout does not sound wrong to me. I can imagine a layout without a need for a header (e.g., XMLLayout). But adding it to the base class would be a lot less intrusive. (...) OK, my suggestion is to keep Layout, SimpleLayout and TTCCLayout as they are, no header. Add a new base class, say, LayoutHeader with virtual tstring getHeader() const = 0 member function and inherit from this new base class and implement the pure virtual member function in PatternLayout. Use dynamic_cast<LayoutHeader *> to test for header availability in appenders where it makes any sense. -- VZ |
From: Steve H. <sha...@mi...> - 2014-01-29 18:20:27
|
On 1/29/14 3:38 AM, "Václav Zeman" <vha...@gm...> wrote: >It seems to me that layout would be a better place for this. > >Is there a prior art for this feature in log4j (or any other Java >logging library) or log4net, etc.? We could copy their design >decisions / interfaces. > With log4j, you have to extend the layout. Here is a link to an article on how to use it: http://www.coderanch.com/t/535099/oa/Inserting-Header-Text-Log-file Personally, I would like to just have it built in as a property - what do you think? |
From: Václav Z. <vha...@gm...> - 2014-01-29 09:38:48
|
On 28 January 2014 23:13, Steve Hartmann wrote: > Hello all, > > I have recently run into a situation in which it would have been really > convenient if the file appenders had some way to add a header line to the > top of each file. This is an interesting idea. I am not opposed to adding this feature to log4cplus. > I don't mind doing the coding for this, but first wanted > to throw the idea out there to see if someone else may have a better idea > for implementation. > > My plan was to simply add an attribute to the file appenders named something > like "FileHeader" which would contain a string. That string would be > inserted as the first line in each file. For example: > > log4cplus.temperatureLogger=DEBUG, A2 > log4cplus.appender.A2=log4cplus::DailyRollingFileAppender > log4cplus.appender.A2.File=log/temperature > log4cplus.appender.A2.layout=log4cplus::PatternLayout > log4cplus.appender.A2.Schedule=DAILY > log4cplus.appender.A2.MaxBackupIndex=2 > log4cplus.appender.A2.FileHeader=Date Temperature1 Setpoint1 Temperature2 > Setpoint2%n > log4cplus.appender.A2.layout.ConversionPattern=%D{%Y-%m-%d %H:%M:%S.%q} > %m%n > > Or should this be implemented in the layout? It seems to me that layout would be a better place for this. Is there a prior art for this feature in log4j (or any other Java logging library) or log4net, etc.? We could copy their design decisions / interfaces. |
From: Steve H. <sha...@mi...> - 2014-01-28 22:31:49
|
Hello all, I have recently run into a situation in which it would have been really convenient if the file appenders had some way to add a header line to the top of each file. I don't mind doing the coding for this, but first wanted to throw the idea out there to see if someone else may have a better idea for implementation. My plan was to simply add an attribute to the file appenders named something like "FileHeader" which would contain a string. That string would be inserted as the first line in each file. For example: log4cplus.temperatureLogger=DEBUG, A2 log4cplus.appender.A2=log4cplus::DailyRollingFileAppender log4cplus.appender.A2.File=log/temperature log4cplus.appender.A2.layout=log4cplus::PatternLayout log4cplus.appender.A2.Schedule=DAILY log4cplus.appender.A2.MaxBackupIndex=2 log4cplus.appender.A2.FileHeader=Date Temperature1 Setpoint1 Temperature2 Setpoint2%n log4cplus.appender.A2.layout.ConversionPattern=%D{%Y-%m-%d %H:%M:%S.%q} %m%n Or should this be implemented in the layout? Thoughts? Regards, Steven Hartmann |
From: Václav Z. <vha...@gm...> - 2014-01-25 08:17:43
|
On 01/24/2014 05:06 PM, Mark Rossman wrote: > Hi, > I'm using log4cplus 1.1.1, and I was wondering if there is a way to > make filenames in the same way you make layouts. I tried: > > log4cplus.appender.A.File=log4cplus::PatternLayout > and > log4cplus.appender.A.File=file-%h.log > > > but neither of these work. I think the ability to use things like data, > host and pid would be useful in filenames. Indeed, this sound useful. -- VZ |
From: Mark R. <ro...@oa...> - 2014-01-24 16:31:44
|
Hi, I'm using log4cplus 1.1.1, and I was wondering if there is a way to make filenames in the same way you make layouts. I tried: log4cplus.appender.A.File=log4cplus::PatternLayout and log4cplus.appender.A.File=file-%h.log but neither of these work. I think the ability to use things like data, host and pid would be useful in filenames. Mark |