log4cplus-devel Mailing List for log4cplus (Page 18)
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. <wi...@us...> - 2011-11-04 15:05:48
|
On Fri, 4 Nov 2011 03:21:49 +0000, Boom LBoom wrote: > Dear Sir/Madam, > > Please suggest solution to solve my problem when I make log4cplus. > > I got error message while "make" command. The error shows as below. > > ld: warning: relocation error: R_386_32: file > .libs/consoleappender.o: > symbol std::cout: external symbolic relocation against > non-allocatable > section .debug_info; cannot be processed at runtime: relocation > ignored > ld: warning: relocation error: R_386_32: file > .libs/consoleappender.o: > symbol std::cerr: external symbolic relocation against > non-allocatable > section .debug_info; cannot be processed at runtime: relocation > ignored > ld: warning: relocation error: R_386_32: file > .libs/consoleappender.o: > symbol std::cout: external symbolic relocation against > non-allocatable > section .debug_info; cannot be processed at runtime: relocation > ignored > ld: warning: relocation error: R_386_32: file > .libs/consoleappender.o: > symbol std::cerr: external symbolic relocation against > non-allocatable > section .debug_info; cannot be processed at runtime: relocation > ignored > ld: warning: relocation error: R_386_32: file .libs/loglog.o: symbol > std::cout: external symbolic relocation against non-allocatable > section .debug_info; cannot be processed at runtime: relocation > ignored > ld: warning: relocation error: R_386_32: file .libs/loglog.o: symbol > std::cerr: external symbolic relocation against non-allocatable > section .debug_info; cannot be processed at runtime: relocation > ignored > ld: warning: relocation error: R_386_32: file .libs/loglog.o: symbol > std::cout: external symbolic relocation against non-allocatable > section .debug_info; cannot be processed at runtime: relocation > ignored > ld: warning: relocation error: R_386_32: file .libs/loglog.o: symbol > std::cerr: external symbolic relocation against non-allocatable > section .debug_info; cannot be processed at runtime: relocation > ignored > > Environment as my project > Server = HP Prolant G5 (CPU Intel) > OS = Solaris 10 (i386) > Compiler = GCC version 4.4.2 I have never seen this problem before. It is only a warning, does the resulting liblog4cplus work for you? Is the 'ld' your GCC is using the GNU ld? What version of log4cplus are you compiling? (...after some searching...) Please try to add -gstabs+ to the CXXFLAGS, e.g., ./configure CXXFLAGS=-gstabs+ etc. -- VZ |
From: Maddie L. <ms...@gm...> - 2011-09-19 15:26:19
|
I am using version 1.0.4 on Ubuntu 2011/9/18 Václav Zeman <v.h...@sh...> > Maddie Leary wrote, On 16.9.2011 22:34: > > Hello, > > > > I've just started working with log4cplus today, it's surprisingly easy to > > use, however, I wish to use it to log to syslog... > > > > I've been looking at this web-page which has a > > SyslogAppender: > http://log4cplus.sourceforge.net/docs/html/classlog4cplus_1_1PropertyConfigurator.html#a21e8e6b1440cc7a8a47b8fd14c54b239 > > > > When I input log4cplus.appender.syslog1=log4cplus::SyslogAppender into my > > log4cplus.properties file and compile I get no errors. But when I run the > > program I get these errors: > > log4cplus:ERROR PropertyConfigurator::configureAppenders()- Cannot find > > AppenderFactory: log4cplus::SyslogAppender > > log4cplus:ERROR PropertyConfigurator::configureLogger()- Invalid > appender: > > syslog1 (syslog1 is the name of my appender here) > > > > Is that code valid? Is there still a SyslogAppender available? If so, how > can > > I go about creating it properly? > It should be available. What version of log4cplus are you using? > > > > > Thank you for your time and assistance, > > Maddie > > -- > VZ > > > > ------------------------------------------------------------------------------ > BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA > http://p.sf.net/sfu/rim-devcon-copy2 > _______________________________________________ > Log4cplus-devel mailing list > Log...@li... > https://lists.sourceforge.net/lists/listinfo/log4cplus-devel > > |
From: Václav Z. <v.h...@sh...> - 2011-09-18 22:01:05
|
Maddie Leary wrote, On 16.9.2011 22:34: > Hello, > > I've just started working with log4cplus today, it's surprisingly easy to > use, however, I wish to use it to log to syslog... > > I've been looking at this web-page which has a > SyslogAppender: http://log4cplus.sourceforge.net/docs/html/classlog4cplus_1_1PropertyConfigurator.html#a21e8e6b1440cc7a8a47b8fd14c54b239 > > When I input log4cplus.appender.syslog1=log4cplus::SyslogAppender into my > log4cplus.properties file and compile I get no errors. But when I run the > program I get these errors: > log4cplus:ERROR PropertyConfigurator::configureAppenders()- Cannot find > AppenderFactory: log4cplus::SyslogAppender > log4cplus:ERROR PropertyConfigurator::configureLogger()- Invalid appender: > syslog1 (syslog1 is the name of my appender here) > > Is that code valid? Is there still a SyslogAppender available? If so, how can > I go about creating it properly? It should be available. What version of log4cplus are you using? > > Thank you for your time and assistance, > Maddie -- VZ |
From: Maddie L. <ms...@gm...> - 2011-09-16 20:35:03
|
Hello, I've just started working with log4cplus today, it's surprisingly easy to use, however, I wish to use it to log to syslog... I've been looking at this web-page which has a SyslogAppender: http://log4cplus.sourceforge.net/docs/html/classlog4cplus_1_1PropertyConfigurator.html#a21e8e6b1440cc7a8a47b8fd14c54b239 When I input log4cplus.appender.syslog1=log4cplus::SyslogAppender into my log4cplus.properties file and compile I get no errors. But when I run the program I get these errors: log4cplus:ERROR PropertyConfigurator::configureAppenders()- Cannot find AppenderFactory: log4cplus::SyslogAppender log4cplus:ERROR PropertyConfigurator::configureLogger()- Invalid appender: syslog1 (syslog1 is the name of my appender here) Is that code valid? Is there still a SyslogAppender available? If so, how can I go about creating it properly? Thank you for your time and assistance, Maddie |
From: Václav Z. <wi...@us...> - 2011-09-03 13:08:52
|
Michel wrote, On 2.9.2011 15:58: > Hi, Hi. > > Do someone know if syslog backend on win32 plateform works using > "http://syslog-win32.sourceforge.net" ? That syslog daemon just uses the syslog UDP protocol, AFAIK. There is no remote syslog functionality in log4cplus. It would basically require implementing a new appender and some support routines for UDP. It should not be that hard but I never got around to do it. -- VZ |
From: Michel <mic...@fr...> - 2011-09-02 13:58:45
|
Hi, Do someone know if syslog backend on win32 plateform works using "http://syslog-win32.sourceforge.net" ? regards, michel |
From: Václav Z. <v.h...@sh...> - 2011-08-16 16:31:10
|
Václav Zeman wrote, On 16.8.2011 10:50: > Hi. > > The PRODUCTION_1_0_x in the Subversion repository is currently in bad > state because of my bad use of Bazaar (yes, Bazaar) against it. I will > be restoring the state from backup later today. > I have corrected the bad commit by restoring the whole repository from backups. -- wilx |
From: Václav Z. <v.h...@sh...> - 2011-08-16 08:50:40
|
Hi. The PRODUCTION_1_0_x in the Subversion repository is currently in bad state because of my bad use of Bazaar (yes, Bazaar) against it. I will be restoring the state from backup later today. -- VZ |
From: Václav Z. <v.h...@sh...> - 2011-08-14 18:45:19
|
Nikita Manovich wrote, On 5.8.2011 23:37: > Hi, > > I integrated the library into a big project. It is very useful and > cool library which helps to improve our logging significantly. But I > found a real issue and it is critical for me. > On Windows we use UNICODE version of the library and log4cplus > doesn't work on localized Windows properly. First of all I was not > able to open a file in case its path contained non-English characters. I have fixed this on PRODUCTION_1_0_x branch. log4cplus will now use the basic_fstream<>'s open()/ctor that takes wchar_t. > After I fixed the bug I found another fundamental problem. I was not > able to log a string with non-English characters (for example, a > path). wfstream doesn't work correctly in this case with the default > locale. I can't modify the global local because it can affect other > parts of the product. > The small patch below fixes these problems but I'm not sure that it > is enough. I did analyze only a small part of the library > (FileAppender). May be you know a better solution? > In my code I wrote several additional lines (utf8_facet I got from boost): > using namespace utf8_facet; > std::locale utf8_locale(std::locale(), new utf8_codecvt_facet()); > pFileAppender->imbue(utf8_locale); I have committed your patch extended with getloc() member function and committed it to PRODUCTION_1_0_x branch in revision 1570. > > > diff -ur log4cplus-1.0.4.orig//include/log4cplus/fileappender.h > log4cplus-1.0.4/include/log4cplus/fileappender.h > --- log4cplus-1.0.4.orig//include/log4cplus/fileappender.h > 2010-05-28 13:06:51.000000000 +0400 > +++ log4cplus-1.0.4/include/log4cplus/fileappender.h 2011-08-06 > 00:25:50.230786400 +0400 > @@ -78,6 +78,10 @@ > // Dtor > virtual ~FileAppender(); > > + // Redefine default locale for output stream. It may be a good idea to > + // provide UTF-8 locale in case UNICODE macro is defined. > + virtual void imbue(std::locale const& loc); > + > // Methods > virtual void close(); > > diff -ur log4cplus-1.0.4.orig//src/fileappender.cxx > log4cplus-1.0.4/src/fileappender.cxx > --- log4cplus-1.0.4.orig//src/fileappender.cxx 2010-09-08 > 17:08:44.000000000 +0400 > +++ log4cplus-1.0.4/src/fileappender.cxx 2011-08-06 > 00:28:12.964058300 +0400 > @@ -333,7 +333,19 @@ > void > FileAppender::open(std::ios::openmode mode) > { > +#if defined (_WIN32) > + // MS SDK supports char and wchar_t. Don't try to convert wstring > to string. > + // It doesn't work. Need to reimplement working with non-english strings. > + out.open(filename.c_str(), mode); > +#else > out.open(LOG4CPLUS_TSTRING_TO_STRING(filename).c_str(), mode); > +#endif > +} > + > +void > +FileAppender::imbue(std::locale const& loc) > +{ > + out.imbue(loc); > } > > bool > diff -ur log4cplus-1.0.4.orig//src/property.cxx log4cplus-1.0.4/src/property.cxx > --- log4cplus-1.0.4.orig//src/property.cxx 2010-07-09 > 12:24:08.000000000 +0400 > +++ log4cplus-1.0.4/src/property.cxx 2011-08-05 15:27:55.395559800 +0400 > @@ -117,7 +117,13 @@ > if (inputFile.empty ()) > return; > > +#if defined (_WIN32) > + // MS SDK supports char and wchar_t. Don't try to convert wstring > to string. > + // It doesn't work. Need to reimplement working with non-english strings. > + tifstream file (inputFile.c_str()); > +#else > tifstream file (LOG4CPLUS_TSTRING_TO_STRING(inputFile).c_str()); > +#endif > init(file); > } > > Thank you. -- wilx |
From: Nikita M. <nik...@gm...> - 2011-08-05 21:37:14
|
Hi, I integrated the library into a big project. It is very useful and cool library which helps to improve our logging significantly. But I found a real issue and it is critical for me. On Windows we use UNICODE version of the library and log4cplus doesn't work on localized Windows properly. First of all I was not able to open a file in case its path contained non-English characters. After I fixed the bug I found another fundamental problem. I was not able to log a string with non-English characters (for example, a path). wfstream doesn't work correctly in this case with the default locale. I can't modify the global local because it can affect other parts of the product. The small patch below fixes these problems but I'm not sure that it is enough. I did analyze only a small part of the library (FileAppender). May be you know a better solution? In my code I wrote several additional lines (utf8_facet I got from boost): using namespace utf8_facet; std::locale utf8_locale(std::locale(), new utf8_codecvt_facet()); pFileAppender->imbue(utf8_locale); diff -ur log4cplus-1.0.4.orig//include/log4cplus/fileappender.h log4cplus-1.0.4/include/log4cplus/fileappender.h --- log4cplus-1.0.4.orig//include/log4cplus/fileappender.h 2010-05-28 13:06:51.000000000 +0400 +++ log4cplus-1.0.4/include/log4cplus/fileappender.h 2011-08-06 00:25:50.230786400 +0400 @@ -78,6 +78,10 @@ // Dtor virtual ~FileAppender(); + // Redefine default locale for output stream. It may be a good idea to + // provide UTF-8 locale in case UNICODE macro is defined. + virtual void imbue(std::locale const& loc); + // Methods virtual void close(); diff -ur log4cplus-1.0.4.orig//src/fileappender.cxx log4cplus-1.0.4/src/fileappender.cxx --- log4cplus-1.0.4.orig//src/fileappender.cxx 2010-09-08 17:08:44.000000000 +0400 +++ log4cplus-1.0.4/src/fileappender.cxx 2011-08-06 00:28:12.964058300 +0400 @@ -333,7 +333,19 @@ void FileAppender::open(std::ios::openmode mode) { +#if defined (_WIN32) + // MS SDK supports char and wchar_t. Don't try to convert wstring to string. + // It doesn't work. Need to reimplement working with non-english strings. + out.open(filename.c_str(), mode); +#else out.open(LOG4CPLUS_TSTRING_TO_STRING(filename).c_str(), mode); +#endif +} + +void +FileAppender::imbue(std::locale const& loc) +{ + out.imbue(loc); } bool diff -ur log4cplus-1.0.4.orig//src/property.cxx log4cplus-1.0.4/src/property.cxx --- log4cplus-1.0.4.orig//src/property.cxx 2010-07-09 12:24:08.000000000 +0400 +++ log4cplus-1.0.4/src/property.cxx 2011-08-05 15:27:55.395559800 +0400 @@ -117,7 +117,13 @@ if (inputFile.empty ()) return; +#if defined (_WIN32) + // MS SDK supports char and wchar_t. Don't try to convert wstring to string. + // It doesn't work. Need to reimplement working with non-english strings. + tifstream file (inputFile.c_str()); +#else tifstream file (LOG4CPLUS_TSTRING_TO_STRING(inputFile).c_str()); +#endif init(file); } -- Best regards, Nikita Manovich. |
From: Deepak M. <dee...@hd...> - 2011-07-13 18:23:55
|
Hello All, First, Let me thank for the log4cplus source code. I am facing one issue as follows: What I am trying to do? I want to log the messages to event log on windows. What did I do? I could get the event logging enabled by in including following .h #include <log4cplus/nteventlogappender.h> And creating the appender as follows: SharedAppenderPtr append_3(new NTEventLogAppender(LOG4CPLUS_TEXT("127.0.0.1"), LOG4CPLUS_TEXT("log"), LOG4CPLUS_TEXT("source"))); append_3->setName(LOG4CPLUS_TEXT("ToEventlog")); Logger to_eventlog = Logger::getInstance(LOG4CPLUS_TEXT("to_eventlog")); to_eventlog.addAppender(append_3); to_eventlog.setLogLevel(log4cplus::ALL_LOG_LEVEL); And logging as Logger to_eventlog = Logger::getInstance(LOG4CPLUS_TEXT("to_eventlog")); LOG4CPLUS_FATAL(to_eventlog, "Test Message."); When I log the message, I get following in the event log: ------------ The description for Event ID 4096 from source source cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: Test Message. the message resource is present but the message is not found in the string/message table ------------ I tried to create a dll with name NTEventLogAppender.dll with string table resource and a string with id 4096 (as hardcoded in the nteventlogappender.cxx file in log4cplus) and compiled it with resource only dll (/NOENTRY) but I still keep getting above error. Any help on how to create this dll would be greatly appreciated. Thanks, ~Deepak Muley 408-970-4363 (Desk) dee...@hd... |
From: Malcolm S. <Mal...@Pr...> - 2011-06-28 23:00:21
|
Possibly, except on our client side the number of days to keep could be anything from 7 to 365..... Sometimes these logs are only for general INFO+ logging, but at other times it could be to troubleshoot problems that are random - hence we need debug logs for an undetermined period of time. I really need this build into log4cplus rather than an external process because it could be used on a server or a user PC. Out of interest, how are you generating those filenames ? Is the 'File' option configurable ? Mal -----Original Message----- From: Alexander Neundorf [mailto:neu...@kd...] Sent: Wednesday, 29 June 2011 5:17 AM Subject: Re: [Log4cplus-devel] Max. Age of DailyRollingFileAppender > I need daily logs, but I need them to be automatically deleted after > 31 days. What I am doing is I create filenames for the logfiles so that they contain the day of the week (e.g. MyLogFile-Monday.log), this way I always have the log files from one week around. Maybe this could also work for you ? Alex |
From: Alexander N. <neu...@kd...> - 2011-06-28 19:34:54
|
On Tuesday 28 June 2011, Malcolm Smith wrote: > I've been looking to see if there are any requests to add a "maxAge" > type of property to DailyRollingFileAppender, but the only thing I can > find (via google) is related to log4j. > > > > I need daily logs, but I need them to be automatically deleted after 31 > days. What I am doing is I create filenames for the logfiles so that they contain the day of the week (e.g. MyLogFile-Monday.log), this way I always have the log files from one week around. Maybe this could also work for you ? Alex |
From: Václav H. <v.h...@sh...> - 2011-06-28 13:24:44
|
On Tue, 28 Jun 2011 18:44:57 +1000, Malcolm Smith wrote: > I've made the following modification for my needs (I need the %r > option supported). I hope this (or something like it) can be added in > a future release. Thank you, I will look into integrating this. > > PatternLayout.cpp > > ============== > > // might want to use a new global - using this for now since it is > always initialized > > namespace log4cplus > > { > > extern helpers::Time TTCCLayout_time_base; > > } > > class RelativeTimeConverter : public PatternConverter { > > public: > > RelativeTimeConverter(const FormattingInfo& info, > > const log4cplus::tstring& pattern); > > virtual log4cplus::tstring convert(const InternalLoggingEvent& > event); > > private: > > log4cplus::tstring format; > > }; > > //////////////////////////////////////////////// > > // RelativeTimeConverter methods: > > //////////////////////////////////////////////// > > log4cplus::pattern::RelativeTimeConverter::RelativeTimeConverter > > (const FormattingInfo& info, > > const log4cplus::tstring& pattern) > > : PatternConverter(info), > > format(pattern) > > { > > } > > log4cplus::tstring > > log4cplus::pattern::RelativeTimeConverter::convert > > (const InternalLoggingEvent& event) > > { > > log4cplus::helpers::Time const rel_time = event.getTimestamp () - > log4cplus::TTCCLayout_time_base; > > return rel_time.getFormattedTime(format, true); > > } > > // in void > log4cplus::pattern::PatternParser::finalizeConverter(log4cplus::tchar > c) > > case LOG4CPLUS_TEXT('r'): > > { > > log4cplus::tstring dOpt = extractOption(); > > if(dOpt.empty ()) { > > dOpt = LOG4CPLUS_TEXT("%H:%M:%S:%q"); > > } > > pc = new RelativeTimeConverter(formattingInfo, dOpt); > > } > > break; > > Mal -- VH |
From: Václav H. <v.h...@sh...> - 2011-06-28 13:21:56
|
On Tue, 28 Jun 2011 09:33:55 +0200, Sylvain Bonnemaison wrote: > Hi, > > I'm using log4cplus-1.0.4 with socket and file appender. My > application > is a web server. When the application received many request, > log4cplus > lock the application at line 160 in "appenderattachableimpl.cxx" : > > int > AppenderAttachableImpl::appendLoopOnAppenders(const > spi::InternalLoggingEvent& event) const > { > int count = 0; > > LOG4CPLUS_BEGIN_SYNCHRONIZE_ON_MUTEX( appender_list_mutex ) > for(ListType::const_iterator it=appenderList.begin(); > it!=appenderList.end(); > ++it) > > Is it a bug or a bad system configuration (not enough shared memory, > etc.) ? It could be a bug. Try to compile with debugging symbols and try to obtain call stacks of all threads for analysis. -- VH |
From: Malcolm S. <Mal...@Pr...> - 2011-06-28 08:45:33
|
I've made the following modification for my needs (I need the %r option supported). I hope this (or something like it) can be added in a future release. PatternLayout.cpp ============== // might want to use a new global - using this for now since it is always initialized namespace log4cplus { extern helpers::Time TTCCLayout_time_base; } class RelativeTimeConverter : public PatternConverter { public: RelativeTimeConverter(const FormattingInfo& info, const log4cplus::tstring& pattern); virtual log4cplus::tstring convert(const InternalLoggingEvent& event); private: log4cplus::tstring format; }; //////////////////////////////////////////////// // RelativeTimeConverter methods: //////////////////////////////////////////////// log4cplus::pattern::RelativeTimeConverter::RelativeTimeConverter (const FormattingInfo& info, const log4cplus::tstring& pattern) : PatternConverter(info), format(pattern) { } log4cplus::tstring log4cplus::pattern::RelativeTimeConverter::convert (const InternalLoggingEvent& event) { log4cplus::helpers::Time const rel_time = event.getTimestamp () - log4cplus::TTCCLayout_time_base; return rel_time.getFormattedTime(format, true); } // in void log4cplus::pattern::PatternParser::finalizeConverter(log4cplus::tchar c) case LOG4CPLUS_TEXT('r'): { log4cplus::tstring dOpt = extractOption(); if(dOpt.empty ()) { dOpt = LOG4CPLUS_TEXT("%H:%M:%S:%q"); } pc = new RelativeTimeConverter(formattingInfo, dOpt); } break; Mal |
From: Sylvain B. <syl...@la...> - 2011-06-28 07:34:03
|
Hi, I'm using log4cplus-1.0.4 with socket and file appender. My application is a web server. When the application received many request, log4cplus lock the application at line 160 in "appenderattachableimpl.cxx" : int AppenderAttachableImpl::appendLoopOnAppenders(const spi::InternalLoggingEvent& event) const { int count = 0; LOG4CPLUS_BEGIN_SYNCHRONIZE_ON_MUTEX( appender_list_mutex ) for(ListType::const_iterator it=appenderList.begin(); it!=appenderList.end(); ++it) Is it a bug or a bad system configuration (not enough shared memory, etc.) ? Thanks, Ruddy32 |
From: Václav H. <v.h...@sh...> - 2011-06-28 06:03:15
|
On Tue, 28 Jun 2011 11:43:31 +1000, Malcolm Smith wrote: > I've been looking to see if there are any requests to add a "maxAge" > type of property to DailyRollingFileAppender, but the only thing I > can > find (via google) is related to log4j. > > I need daily logs, but I need them to be automatically deleted after > 31 days. You could emulate this using a cron job (as this sounds like some sort of long running server thing). > > Is this in the pipeline ? I have added it to my TODO list but I cannot promise anything. > > Mal -- VH |
From: Malcolm S. <Mal...@Pr...> - 2011-06-28 01:44:09
|
I've been looking to see if there are any requests to add a "maxAge" type of property to DailyRollingFileAppender, but the only thing I can find (via google) is related to log4j. I need daily logs, but I need them to be automatically deleted after 31 days. Is this in the pipeline ? Mal |
From: Jeremy C. R. <re...@re...> - 2011-06-01 20:00:40
|
System is: SunOS 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V240 Compiler is: Sun C++ 5.10 SunOS_sparc 2009/06/03 Using 1.0.4 source, but also have same problem with latest subversion trunk. ./configure --prefix=/udir/jreed/opt/log4cplus-1.0.4-sunstudio The resulting library has: $ elfdump src/.libs/liblog4cplus.so | grep AUDIT [11] AUDIT 0x32cb6 threads Running a test results in: $ tests/timeformat_test/timeformat_test ld.so.1: timeformat_test: fatal: threads: open failed: No such file or directory ld.so.1: timeformat_test: fatal: threads: audit initialization failure: disabled Killed $ elfdump tests/timeformat_test/.libs/timeformat_test | grep AUDIT [12] DEPAUDIT 0xd93 threads [13] AUDIT 0xd93 threads By the way, how to run the tests using make? I don't see any make target to run them. See this truss output: $ truss tests/timeformat_test/.libs/timeformat_test execve("tests/timeformat_test/.libs/timeformat_test", 0xFFBFFB24, 0xFFBFFB2C) argc = 1 resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12 getcwd("/export/home/users/jreed/src/log4cplus/log4cplus-1.0.4", 979) = 0 resolvepath("/export/home/users/jreed/src/log4cplus/log4cplus-1.0.4/tests/timeformat_test/.libs/timeformat_test", "/export/home/users/jreed/src/log4cplus/log4cplus-1.0.4/tests/timeformat_test/.libs/timeformat_test", 1023) = 98 stat("/export/home/users/jreed/src/log4cplus/log4cplus-1.0.4/tests/timeformat_test/.libs/timeformat_test", 0xFFBFF900) = 0 open("/var/ld/ld.config", O_RDONLY) Err#2 ENOENT stat("/udir/jreed/opt/log4cplus-1.0.4-sunstudio/lib/threads", 0xFFBFF3A0) Err#2 ENOENT stat("/export/home/opt/sunstudio12.1/lib/rw7/threads", 0xFFBFF3A0) Err#2 ENOENT stat("/export/home/opt/sunstudio12.1/lib/stlport4/threads", 0xFFBFF3A0) Err#2 ENOENT stat("/export/home/opt/sunstudio12.1/lib/sparc/threads", 0xFFBFF3A0) Err#2 ENOENT stat("/export/home/opt/sunstudio12.1/lib/threads", 0xFFBFF3A0) Err#2 ENOENT stat("/usr/ccs/lib/threads", 0xFFBFF3A0) Err#2 ENOENT stat("/lib/threads", 0xFFBFF3A0) Err#2 ENOENT stat("/usr/lib/threads", 0xFFBFF3A0) Err#2 ENOENT stat("/lib/threads", 0xFFBFF3A0) Err#2 ENOENT stat("/usr/lib/threads", 0xFFBFF3A0) Err#2 ENOENT ld.so.1: timeformat_test: fatal: threads: open failed: No such file or directory write(2, " l d . s o . 1 : t i m".., 81) = 81 ld.so.1: timeformat_test: fatal: threads: audit initialization failure: disabled write(2, " l d . s o . 1 : t i m".., 81) = 81 lwp_self() I don't understand why it stat() all these non-existent "threads" files and then fails with no such file. Anyone know about this audit problem? I am guessing some compiler/linker option is missing or added but I can't see it yet. My generated src/Makefile is at http://bind10.isc.org/~jreed/nxahuf-Makefile.txt and config.log is at: http://bind10.isc.org/~jreed/nxahuf-config.log.txt Jeremy C. Reed echo 'EhZ[h ^jjf0%%h[[Zc[Z_W$d[j%Xeeai%ZW[ced#]dk#f[d]k_d%' | \ tr '#-~' '\-.-{' |
From: Jeremy C. R. <re...@re...> - 2011-06-01 19:52:04
|
On Tue, 31 May 2011, V?clav Haisman wrote: > > But nm shows: > > > > [2134] | 251340| 48|FUNC |GLOB |0 |227 > > |log4cplus::Logger::getInstance(std::string ) > > > > Notice that the "const" and the "&" (ampersand) is gone. > That sounds like you could have headers/binaries mismatch. Another > thing, try putting the -llog4cplus at the end of the command line. Maybe but I couldn't find a mismatch. I also tried different link order. So I built with Sunstudio CC instead of gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath) and the problem went away: [1040] | 593856| 88|FUNC |GLOB |3 |9 |log4cplus::Logger log4cplus::Logger::getInstance(const std::string &) I have different issue. I will send a new email for that. |
From: Jeremy C. R. <re...@re...> - 2011-06-01 18:18:27
|
Using latest subversion trunk revision 1535 with: Sun C++ 5.10 SunOS_sparc 2009/06/03 /export/home/opt/sunstudio12.1/prod/bin/ccfe -y-o -yclogger.o -I../include -I../include +w -y-fbe -y/export/home/opt/sunstudio12.1/prod/bin/fbe -y-xarch=generic -y-verbose -O0 -ptf /tmp/25726%1.%2 -ptx /export/home/opt/sunstudio12.1/prod/bin/CC -ptk "-DHAVE_CONFIG_H -DINSIDE_LOG4CPLUS -I../include -I../include -DNDEBUG -D_REENTRANT -g -v +w -library=stlport4 -library=Crun -D_REENTRANT -xthreadvar -c " -D__SunOS_5_10 -D__SUNPRO_CC=0x5100 -Dunix -Dsun -Dsparc -D__sparc -D__sparcv8plus -D__unix -D__sun -D__SunOS -D__BUILTIN_VA_ARG_INCR -D__SVR4 -D__SUNPRO_CC_COMPAT=5 -D__SUN_PREFETCH -g +d -y-g -xdbggen=no%stabs+dwarf2 -y-xmemalign=8i -I-xbuiltin -y-xthreadvar=%all -xldscope=global -instlib=/export/home/opt/sunstudio12.1/prod/lib/stlport4/libstlport.a -I/export/home/opt/sunstudio12.1/prod/include/CC/stlport4 -I/export/home/opt/sunstudio12.1/prod/include/CC -I/export/home/opt/sunstudio12.1/prod/include/CC/rw7 -I/export/home/opt/sunstudio12.1/prod/include/cc -y-comdat -DHAVE_CONFIG_H -DINSIDE_LOG4CPLUS -DNDEBUG -D_REENTRANT -D_REENTRANT clogger.cxx -s /tmp/ccfe.25726.0.s >&/tmp/ccfe.25726.1.err rm /tmp/ccfe.25726.0.s /export/home/opt/sunstudio12.1/prod/bin/stdlibfilt -stderr </tmp/ccfe.25726.1.err "clogger.cxx", line 157: Error: va_list is not defined. "clogger.cxx", line 158: Error: Cannot assign void* to int. "clogger.cxx", line 189: Error: va_list is not defined. "clogger.cxx", line 190: Error: Cannot assign void* to int. 4 Error(s) detected. rm /tmp/ccfe.25726.1.err *** Error code 1 make: Fatal error: Command failed for target `clogger.lo' Current working directory /export/home/users/jreed/src/log4cplus/log4cplus/trunk/src My workaround for this: Index: src/clogger.cxx =================================================================== --- src/clogger.cxx (revision 1535) +++ src/clogger.cxx (working copy) @@ -30,7 +30,7 @@ #include <cerrno> #include <cstdio> -#include <cstdarg> +#include <stdarg.h> /* for va_list */ #include <cstring> #include <sstream> Later when linking: Undefined first referenced symbol in file bind .libs/socket-unix.o send .libs/socket-unix.o accept .libs/socket-unix.o listen .libs/socket-unix.o socket .libs/socket-unix.o setsockopt .libs/socket-unix.o connect .libs/socket-unix.o getaddrinfo .libs/socket-unix.o freeaddrinfo .libs/socket-unix.o inet_addr .libs/socket-unix.o So was missing -lsocket -lnsl I tracked that down to the checks for these: configure kept failing with: CC: Warning: Option -Wall passed to ld, if ld is invoked, ignored otherwise ### command line files and options (expanded): ... /usr/ccs/bin/ld: illegal option -- W So no success for AC_SEARCH_LIBS so was never defined. So I built with --disable-warnings. That worked-around that problem. Please fix so -W is not passed to Sun's ld. I see your configure.in does have some "sun" support but not working correct. I did not have these problems with 1.0.4. I stopped using trunk after I installed since I had some problems with loggingmacros.h no longer included and some hierarchy changes (I think) so I went back to 1.0.4 for our current use. Jeremy C. Reed echo 'EhZ[h ^jjf0%%h[[Zc[Z_W$d[j%Xeeai%ZW[ced#]dk#f[d]k_d%' | \ tr '#-~' '\-.-{' |
From: Václav H. <v.h...@sh...> - 2011-05-31 21:03:10
|
Jeremy C. Reed wrote, On 31.5.2011 22:28: > Using Sunstudio CC: Sun C++ 5.10 SunOS_sparc 2009/06/03 > > $ /usr/bin/CC -I/udir/jreed/opt/log4cplus/include -L/udir/jreed/opt/log4cplus/lib -llog4cplus ~/l1.cc > Undefined first referenced > symbol in file > log4cplus::Logger::~Logger() l1.o > log4cplus::Logger log4cplus::Logger::getInstance(const std::string &) > l1.o > ld: fatal: Symbol referencing errors. No output written to a.out > > > Here is example code: > > $ cat ~/l1.cc > #include <log4cplus/logger.h> > > int main () > { > using namespace log4cplus; > Logger logger = Logger::getInstance("main"); > return 0; > } > > Using g++ for this compiles/links fine. I think Sunstudio is more > strict by default. > > Note that the installed log4cplus was builting using g++ (GCC) 3.4.3 > (csl-sol210-3_4-branch+sol_rpath). > > So the installed header and the logger.cxx code has: > > static Logger getInstance(const log4cplus::tstring& name); > > getInstance (const log4cplus::tstring& name) > > But nm shows: > > [2134] | 251340| 48|FUNC |GLOB |0 |227 |log4cplus::Logger::getInstance(std::string ) > > Notice that the "const" and the "&" (ampersand) is gone. > > As for the other undefined symbol, I don't know. > > $ nm ~/opt/log4cplus/lib/liblog4cplus.so | c++filt | grep log4cplus::Logger::~Logger > [1852] | 251568| 104|FUNC |GLOB |0 |227 |log4cplus::Logger::~Logger() > [2116] | 251136| 108|FUNC |GLOB |0 |227 |log4cplus::Logger::~Logger() > [1369] | 251460| 108|FUNC |GLOB |0 |227 |log4cplus::Logger::~Logger() > > > I had this problem with 1.0.4 and with code from subversion (I am at > revision 1535). > > This may not be a log4cplus problem, but maybe someone here recognizes > this or has some ideas? > That sounds like you could have headers/binaries mismatch. Another thing, try putting the -llog4cplus at the end of the command line. -- VH |
From: Jeremy C. R. <re...@re...> - 2011-05-31 20:28:12
|
Using Sunstudio CC: Sun C++ 5.10 SunOS_sparc 2009/06/03 $ /usr/bin/CC -I/udir/jreed/opt/log4cplus/include -L/udir/jreed/opt/log4cplus/lib -llog4cplus ~/l1.cc Undefined first referenced symbol in file log4cplus::Logger::~Logger() l1.o log4cplus::Logger log4cplus::Logger::getInstance(const std::string &) l1.o ld: fatal: Symbol referencing errors. No output written to a.out Here is example code: $ cat ~/l1.cc #include <log4cplus/logger.h> int main () { using namespace log4cplus; Logger logger = Logger::getInstance("main"); return 0; } Using g++ for this compiles/links fine. I think Sunstudio is more strict by default. Note that the installed log4cplus was builting using g++ (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath). So the installed header and the logger.cxx code has: static Logger getInstance(const log4cplus::tstring& name); getInstance (const log4cplus::tstring& name) But nm shows: [2134] | 251340| 48|FUNC |GLOB |0 |227 |log4cplus::Logger::getInstance(std::string ) Notice that the "const" and the "&" (ampersand) is gone. As for the other undefined symbol, I don't know. $ nm ~/opt/log4cplus/lib/liblog4cplus.so | c++filt | grep log4cplus::Logger::~Logger [1852] | 251568| 104|FUNC |GLOB |0 |227 |log4cplus::Logger::~Logger() [2116] | 251136| 108|FUNC |GLOB |0 |227 |log4cplus::Logger::~Logger() [1369] | 251460| 108|FUNC |GLOB |0 |227 |log4cplus::Logger::~Logger() I had this problem with 1.0.4 and with code from subversion (I am at revision 1535). This may not be a log4cplus problem, but maybe someone here recognizes this or has some ideas? Thanks, Jeremy C. Reed |
From: Václav H. <v.h...@sh...> - 2011-04-07 05:34:31
|
Nate Reid wrote, On 7.4.2011 2:27: > I've subclassed FileAppender with my own custom class and I would like to > use the log4cplus properties system to configure the logging to use the > custom class. The problem is that it appears that the custom class needs to > be registered with the AppenderFactory. However, it looks like the > registration, although done at runtime with the call to > initializeFactoryRegistry() from src/factory.cxx does the trick, it only > registers the Appenders/etc that it's aware of. It also looks like the > FactoryTemp and support classes are an implementation detail of factory.cxx > and do not appear to be accessible externally. E.g. they are not defined in > the factory header file. > Is there a way to register custom Appenders/etc so that they can be used > within a Property configuration? > I'd like to have something like this: > > // log.properties > > log4cplus.rootLogger=DEBUG, Custom > log4cplus.appenders.Custom=CustomNS::MyAppender > ... > > Thanks! > -Nate > > P.S. sorry for cross-posting this to the wilx list as well. You can have that. Just get the appenders registry using log4cplus::spi::getAppenderFactoryRegistry() and register your own custom appender factory class inherited from log4cplus::spi::AppenderFactory with all the appropriate member functions overriden. Something like this should do it: class MyAppenderFactory : public log4cplus::spi::AppenderFactory { virtual log4cplus::tstring getTypeName() {...} virtual SharedAppenderPtr createObject(const log4cplus::helpers::Properties& props) {...} }; log4cplus::getAppenderFactoryRegistry().put(std::auto_ptr<log4cplus::spi::AppenderFactory>(new MyAppenderFactory)); -- wilx |