log4cplus-devel Mailing List for log4cplus (Page 15)
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: John L. <jl...@bl...> - 2012-08-01 15:26:05
|
Hello, I'd like to ask about compatibility of log4cplus::tstring between 1.0.x and 1.1.x An application (bind10) has some code like so: // Convert logging level to string. If the level is a valid debug level, // return the string DEBUG, else return the empty string. log4cplus::tstring LoggerLevelImpl::logLevelToString(log4cplus::LogLevel level) { Level bindlevel = convertToBindLevel(level); Severity& severity = bindlevel.severity; int& dbglevel = bindlevel.dbglevel; if ((severity == DEBUG) && ((dbglevel >= MIN_DEBUG_LEVEL) && (dbglevel <= MAX_DEBUG_LEVEL))) { return (tstring("DEBUG")); } // Unknown, so return empty string for log4cplus to try other conversion // functions. return (tstring()); } // Initialization. Register the conversion functions with the LogLevelManager. void LoggerLevelImpl::init() { // Get the singleton log-level manager. LogLevelManager& manager = getLogLevelManager(); // Register the conversion functions manager.pushFromStringMethod(LoggerLevelImpl::logLevelFromString); manager.pushToStringMethod(LoggerLevelImpl::logLevelToString); } which compiles correctly against 1.0.x But compiling against 1.1.x results in logger_level_impl.cc:189:1: error: prototype for ‘const tstring& isc::log::LoggerLevelImpl::logLevelToString(log4cplus::LogLevel)’ does not match any in class ‘isc::log::LoggerLevelImpl’ ../../../src/lib/log/logger_level_impl.h:115:31: error: candidate is: static log4cplus::tstring isc::log::LoggerLevelImpl::logLevelToString(log4cplus::LogLevel) In static member function ‘static void isc::log::LoggerLevelImpl::init()’: Changing the application code to read as follows fixes the problem ... // Convert logging level to string. If the level is a valid debug level, // return the string DEBUG, else return the empty string. log4cplus::tstring const & LoggerLevelImpl::logLevelToString(log4cplus::LogLevel level) { static const tstring debug_string("DEBUG"); static const tstring empty_string; Level bindlevel = convertToBindLevel(level); Severity& severity = bindlevel.severity; int& dbglevel = bindlevel.dbglevel; if ((severity == DEBUG) && ((dbglevel >= MIN_DEBUG_LEVEL) && (dbglevel <= MAX_DEBUG_LEVEL))) { return (debug_string); } // Unknown, so return empty string for log4cplus to try other conversion // functions. return (empty_string); } but creates two new problems: . code is less general - every possible string value which might be returned must be explicitly declared (fortunately there are only two - "DEBUG" and "") . code no longer compiles against 1.0.x - logger_level_impl.cc: In static member function 'static void isc::log::LoggerLevelImpl::init()': logger_level_impl.cc:217: error: invalid conversion from 'const log4cplus::tstring& (*)(log4cplus::LogLevel)' to 'log4cplus::tstring (*)(log4cplus::LogLevel)' logger_level_impl.cc:217: error: initializing argument 1 of 'void log4cplus::LogLevelManager::pushToStringMethod(log4cplus::tstring (*)(log4cplus::LogLevel))' Has anyone else run into this? And is it possible to write the application code for registering and running the logLevelToString() method in such a way that it compiles correctly against both log4cplus releases? John Lumby |
From: Jeremy C. R. <re...@re...> - 2012-08-01 14:07:32
|
I didn't see any release notes in 1.1.0-RC6 (sorry I didn't try RC7 yet) about any incompatibilities with 1.0.4. Will there be any notes about it or upgrade hints? We want to support both versions. For example, to support two versions we have: #if (LOG4CPLUS_VERSION >= LOG4CPLUS_MAKE_VERSION(1, 1, 0)) typedef log4cplus::tstring const & LogLevelString; #else typedef log4cplus::tstring LogLevelString; #endif |
From: Václav Z. <vha...@gm...> - 2012-07-31 20:24:44
|
On 07/31/2012 09:43 PM, Jeremy C. Reed wrote: > On Tue, 31 Jul 2012, V?clav Zeman wrote: > >> - Disabled __thread (TLS) detection for NetBSD. It is broken there. > Any ticket or reference to this? Thanks. No, no tickets related to this. I have found that during my testing. More digging shows that it is probably fixed post-5.0.2. But I am testing with 5.0.2. NetBSD 5.0.2 has been released February 2010. This email http://mail-index.netbsd.org/tech-userlevel/2011/03/08/msg004665.html suggests that the necessary support has been only added after March 2011. Hmm, I guess that the check thus can be re-enabled for NetBSD 5.1.x and later. -- VZ |
From: Jeremy C. R. <re...@re...> - 2012-07-31 20:03:08
|
On Tue, 31 Jul 2012, V?clav Zeman wrote: > - Disabled __thread (TLS) detection for NetBSD. It is broken there. Any ticket or reference to this? Thanks. |
From: Václav Z. <vha...@gm...> - 2012-07-31 19:03:50
|
Hi. I have released log4cplus 1.1.0-RC7. It contains some bug fixes and also new features: IMPORTANT: Builds with --with-iconv configure switch now assume UTF-8 for plain char strings. - Bumped up SO version for UDP sockets support related changes. - Removed Windows CE support. - Regenerated with Automake 1.12.2. - Fixed Fedora RPM builds spec file. - Implemented log4cplus.disableOverride similar to log4j's log4j.disableOverride. - Improved support of profiling and debugging builds with Sun CC. - Added documentation for configure script options. - Added detection and use of clock_nanosleep(). - Disabled __thread (TLS) detection for NetBSD. It is broken there. - New appender: Log4jUdpAppender. It allows logging using UDP with log4j XML payload to Chainsaw or Log2Console. (Siva Chandran P) - Added support for __func__ as function name source for logging events. -- VZ |
From: Václav Z. <vha...@gm...> - 2012-07-30 16:22:15
|
On 07/28/2012 08:08 PM, Siva Chandran P wrote: > Hi Václav Zeman, Hi. > > Please find the attached patch which adds support for Log4J UDP > appender. I am able to build log4cplus trunk with this patch on > Windows using Visual Studio 2008. I am also able to receive logs from > log4judpappender using Log2Console. The following log configuration > enables log4judpappender. > > log4cplus.appender.NetworkAppender=log4cplus::Log4jUdpAppender > log4cplus.appender.NetworkAppender.host=localhost > log4cplus.appender.NetworkAppender.port=5000 > > I tried my best to match with your naming & coding style/convention. > Please feel free to make changes on the patch to match with log4cplus > code base. > > Let me know if you need any other information. I have integrated to your patch into _Bazaar_ repository trunk branch. (I think you have based your patch on Subversion's trunk.) See < https://sourceforge.net/scm/?type=bzr&group_id=40830> for access information. Thank you for your submission. It is a great addition for log4cplus. -- VZ |
From: SourceForge.net <no...@so...> - 2012-07-14 13:10:29
|
Bugs item #3539046, was opened at 2012-06-29 12:55 Message generated for change (Comment added) made by wilx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3539046&group_id=40830 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Build Group: v1.1.x Status: Open Resolution: Remind Priority: 5 Private: No Submitted By: Brian (badrizzle) Assigned to: Václav Zeman (wilx) Summary: log4cplus.spec file fails in Fedora 14 Initial Comment: when running rpmbuild -ta ~/rpmbuild/SOURCES/log4cplus-1.0.4.1.tar.gz , several error occur 1) "Copyright" is not recognized with rpmbuild, should be replaced with "License" 2) the version number at top is "1.0.4", should be "1.0.4.1" 3) several headers in the include/log4cplus/config directory are not expected and thus rpmbuild breaks. Attached is the spec file that I used that got me through everything. ---------------------------------------------------------------------- >Comment By: Václav Zeman (wilx) Date: 2012-07-14 06:10 Message: Could you please check your rpmbuild with the attached log4cplus.spec file instead? I think that your changes removing all of the log4cplus/config* files is not correct. The attached spec file changes it to do this instead: rm -f $RPM_BUILD_ROOT%{prefix}/include/log4cplus/config/stamp-* rm -f $RPM_BUILD_ROOT%{prefix}/include/log4cplus/config/*.in rm -f $RPM_BUILD_ROOT%{prefix}/include/log4cplus/stamp-* The log4cplus.spec file also contains some additional changes that I think might be beneficial. ---------------------------------------------------------------------- Comment By: Václav Zeman (wilx) Date: 2012-06-29 14:01 Message: I have committed your version of the file to 1.0.4.1 branch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3539046&group_id=40830 |
From: SourceForge.net <no...@so...> - 2012-07-12 04:45:02
|
Bugs item #3539046, was opened at 2012-06-29 12:55 Message generated for change (Settings changed) made by wilx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3539046&group_id=40830 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Build >Group: v1.1.x >Status: Open >Resolution: Remind Priority: 5 Private: No Submitted By: Brian (badrizzle) Assigned to: Václav Zeman (wilx) Summary: log4cplus.spec file fails in Fedora 14 Initial Comment: when running rpmbuild -ta ~/rpmbuild/SOURCES/log4cplus-1.0.4.1.tar.gz , several error occur 1) "Copyright" is not recognized with rpmbuild, should be replaced with "License" 2) the version number at top is "1.0.4", should be "1.0.4.1" 3) several headers in the include/log4cplus/config directory are not expected and thus rpmbuild breaks. Attached is the spec file that I used that got me through everything. ---------------------------------------------------------------------- Comment By: Václav Zeman (wilx) Date: 2012-06-29 14:01 Message: I have committed your version of the file to 1.0.4.1 branch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3539046&group_id=40830 |
From: Václav Z. <vha...@gm...> - 2012-07-06 18:21:17
|
On 07/06/2012 07:53 PM, Michel wrote: > Hi, > > I 'm a log4cplus beginer enjoyed by all thé features possible. Do you know where i can find a good tuto about create a custom appender and register it in your lib? Well, there is no such tutorial as far as I know. The code of log4cplus' own appenders might work as one. Take a look at the NullAppender. It shows the absolute minimum that you need to have for a valid appender. Obviously, you will want to change the empty append() function to do something useful. As for registration, take a look at trunk or 1.1.0-RC6 source, qt4debugappender.cxx. It has Qt4DebugAppender::registerAppender() which shows what you need to do to register external appender into log4cplus:: name space. To register your appender into custom namespace use something like this instead (untested): log4cplus::spi::AppenderFactoryRegistry & reg = log4cplus::spi::getAppenderFactoryRegistry (); LOG4CPLUS_REG_PRODUCT (reg, "MyNamespace::", MyAppender, MyNamespace::, log4cplus::spi::AppenderFactory) Your properties files will then be able to instantiate your appender as MyNamespace::MyAppender. > > thanks for the great job Thank you. -- VZ |
From: Michel <mic...@fr...> - 2012-07-06 17:53:30
|
Hi, I 'm a log4cplus beginer enjoyed by all thé features possible. Do you know where i can find a good tuto about create a custom appender and register it in your lib? thanks for the great job michel |
From: Václav Z. <vha...@gm...> - 2012-07-06 11:32:53
|
Hi. I would like to thank everyone who responded to my feedback request. It is nice to know that log4cplus is being used in both commercial and free open source software. Some of the feedback contained feature wishes: - Pre-built binaries - Windows/MSVC10 - Windows/QtCreator - Windows/MinGW - Linux/Ubuntu I will try to provide binaries for Windows/*. The binaries for Linux/Ubuntu already do exist: <http://packages.ubuntu.com/search?keywords=liblog4cplus&searchon=names&suite=all§ion=all> - FileAppender et al. - Create target directory when it is missing. - Start new log file at midnight for DailyRollingFileAppender with daily schedule. - Provide more flexible naming of DailyRollingFileAppender log files. Creating missing path is easy and I will attempt to make this work for 1.1.0-RC7. I vaguely remember that the DailyRollingFileAppender stuff was tricky but I will try to make the rolling by midnight work in 1.1.1. - Synchronization for logging from multiple processes This is now fixed on trunk by addition of file based locking to all appenders. - Some kind of ServerSocketAppender that would act like a Telnet (or SSH) server. The sockets abstractions in log4cplus are somewhat weak and they will first need some work for this to be doable. Either that or this could be implemented as additional library/DLL separate from log4cplus core itself. -- VZ |
From: Václav Z. <vha...@gm...> - 2012-07-03 19:11:32
|
Hi. I have released log4cplus 1.1.0-RC6. It contains some bug fixes as well as new features: - Fixed compilation for build with wchar_t being alias to unsigned short (/Zc:wchar_t-) (Windows). - Added new appender CLFSAppender (experimental), based on Microsoft Common Log File System API. - Added new appender Qt4DebugAppender (experimenta), based on Qt4's qDebug(), qWarning() and qCritical() functions. - Fixed bug #3530769 - compilation issues with Visual Studio 2011. - Added log4cplus.quietMode property handling to PropertyConfigurator. - Added #pragma once to all headers. - Implemented Time::gettimeofday() using Win32 API's GetSystemTimeAsFileTime(). - Moved file based locking from FileAppender to Appender to make it available for all appenders. - Changed Windows configuration to use __declspec(thread) when compiling for Windows Vista or later and TlsAlloc() otherwise. - Implemented %r PatternLayout format specifier - miliseconds since process start. - Fixed bug #3101459 - TTCCLayout time is not in milliseconds since process start by default. -- VZ |
From: SourceForge.net <no...@so...> - 2012-07-03 18:03:05
|
Bugs item #3101459, was opened at 2010-11-02 02:39 Message generated for change (Comment added) made by wilx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3101459&group_id=40830 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: v1.0.4 Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Jacek Sieka (arnetheduck) Assigned to: Václav Zeman (wilx) Summary: TTCCLayout should print millis since start, not date/time Initial Comment: According to the documentation, the first field of TTCClayout should be milliseconds since startup - instead it prints formatted date/time ---------------------------------------------------------------------- >Comment By: Václav Zeman (wilx) Date: 2012-07-03 11:03 Message: This is now fixed on trunk as well. ---------------------------------------------------------------------- Comment By: Václav Zeman (wilx) Date: 2010-11-23 09:36 Message: I have implemented the behaviour as described by the documentation in revision 1490 on PRODUCITON_1_0_x branch. Now, when DateFormat property of TTCCLayout is not set or when it is empty, the time is shown as milliseconds since start of application. ---------------------------------------------------------------------- Comment By: Václav Zeman (wilx) Date: 2010-11-04 14:40 Message: The docs were taken from log4j docs verbatim, it seems. Unfortunately, log4cplus does not implement the behaviour/layout the same as log4j does. The relative time since start is not possible at the moment. You could get absolute (instead of relative) time in milliseconds since epoch using "%s%q" for DateFormat property. I will fix the documentation to reflect the real state of things and I will try to implement the relative time some time in the future. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3101459&group_id=40830 |
From: SourceForge.net <no...@so...> - 2012-06-29 21:01:30
|
Bugs item #3539046, was opened at 2012-06-29 12:55 Message generated for change (Comment added) made by wilx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3539046&group_id=40830 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Build Group: v1.0.4.1 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Brian (badrizzle) Assigned to: Václav Zeman (wilx) Summary: log4cplus.spec file fails in Fedora 14 Initial Comment: when running rpmbuild -ta ~/rpmbuild/SOURCES/log4cplus-1.0.4.1.tar.gz , several error occur 1) "Copyright" is not recognized with rpmbuild, should be replaced with "License" 2) the version number at top is "1.0.4", should be "1.0.4.1" 3) several headers in the include/log4cplus/config directory are not expected and thus rpmbuild breaks. Attached is the spec file that I used that got me through everything. ---------------------------------------------------------------------- >Comment By: Václav Zeman (wilx) Date: 2012-06-29 14:01 Message: I have committed your version of the file to 1.0.4.1 branch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3539046&group_id=40830 |
From: SourceForge.net <no...@so...> - 2012-06-29 19:55:08
|
Bugs item #3539046, was opened at 2012-06-29 12:55 Message generated for change (Tracker Item Submitted) made by badrizzle You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3539046&group_id=40830 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Build Group: v1.0.4.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Brian (badrizzle) Assigned to: Václav Zeman (wilx) Summary: log4cplus.spec file fails in Fedora 14 Initial Comment: when running rpmbuild -ta ~/rpmbuild/SOURCES/log4cplus-1.0.4.1.tar.gz , several error occur 1) "Copyright" is not recognized with rpmbuild, should be replaced with "License" 2) the version number at top is "1.0.4", should be "1.0.4.1" 3) several headers in the include/log4cplus/config directory are not expected and thus rpmbuild breaks. Attached is the spec file that I used that got me through everything. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3539046&group_id=40830 |
From: Václav Z. <vha...@gm...> - 2012-06-18 08:14:44
|
On 18 June 2012 09:09, Václav Zeman wrote: > On 18 June 2012 07:23, Václav Zeman wrote: >> On 06/18/2012 07:03 AM, Ulrich Heinicke wrote: >>> Hi, >>> i want to use a configuration file like this: >>> >>> # switch on general logging (reports ALL levels to ROLLFILE and OUTPUT) >>> log4cplus.rootLogger=ALL, ROLLFILE, OUTPUT >>> >>> # switch on release-logging (reports only warnings and errors levels to >>> ROLLFILE) >>> #log4cplus.rootLogger=WARN, ROLLFILE >>> >>> # switch off general logging >>> #log4cplus.rootLogger=OFF >>> >>> # explicitely enable loggers (even if general logging is off) >>> #log4cplus.logger.IBHStatik=ALL, ROLLFILE >>> #log4cplus.logger.IBHCore=ALL, ROLLFILE >>> >>> # setup the ROLLFILE >>> log4cplus.appender.ROLLFILE=log4cplus::RollingFileAppender >>> log4cplus.appender.ROLLFILE.MaxFileSize=1000KB >>> log4cplus.appender.ROLLFILE.MaxBackupIndex=50 >>> log4cplus.appender.ROLLFILE.layout=log4cplus::PatternLayout >>> log4cplus.appender.ROLLFILE.layout.ConversionPattern=%d %-5p (%F:%L) - %m%n >>> >>> but the filename for the RollingFileAppender i will set in my application. >>> >>> How can i do this? >> This is not supported directly but it is doable. You can load the >> properties file first: >> >> log4cplus::helpers::Properties props (LOG4CPLUS_TEXT ("foo.properties")); >> >> Then you can modify the properties set and add additional property with >> the file name: >> >> props.setProperty (LOG4CPLUS_TEXT ("log4cplus.appender.ROLLFILE.File"), file_path_string_here); >> >> After this you can do the configuration process as usual but with the props variable as argument to the PropertyConfigurator ctor: >> >> log4cplus::PropertyConfigurator conf (props); >> >> Depending on you application, you might want to use or not use the fShadowEnvironment flag to the PropertyConfigurator to give higher priority to the property rather than to environment variables. By default, environment variables override properties. > Actually, this is not relevant to the above solution. I had this in > mind when I thought about a slightly different solution. In this > different solution you would add a line like this to the properties > file: > > log4cplus.appender.ROLLFILE.File=${FILENAME} > > Then you would set the property's value in your code. > > props.setPropery (LOG4CPLUS_TEXT ("FILENAME"), file_path_string_here); > > Depending on the fShadowEnvironment flag absence or presence, it could > be or could not be overridden using same name environment variable. > >> >> I have not tested this but I think it should work this way. HTH. I am resending the answer to the list. -- VZ |
From: Andreas B. <bie...@co...> - 2012-06-18 07:18:01
|
Dear Ulrich Heinicke, we used environment variables for that in our project. On 18.06.2012 07:06, Ulrich Heinicke wrote: > Hi, > i want to use a configuration file like this: <snip> > # setup the ROLLFILE > log4cplus.appender.ROLLFILE=log4cplus::RollingFileAppender > log4cplus.appender.ROLLFILE.MaxFileSize=1000KB log4cplus.appender.ROLLFILE.File=${LOGFILE_PATTERN} <snip> And in sthe code something like: ---8<--- // put some variables in the environment that can be used in the // configuration file setenv("LOGFILE_PATTERN", "/my/cool/log/file", 0); --->8--- But I'm curious if there is another way to do that. best regards Andreas Bießmann |
From: Ulrich H. <uhe...@ib...> - 2012-06-18 05:06:34
|
Hi, i want to use a configuration file like this: # switch on general logging (reports ALL levels to ROLLFILE and OUTPUT) log4cplus.rootLogger=ALL, ROLLFILE, OUTPUT # switch on release-logging (reports only warnings and errors levels to ROLLFILE) #log4cplus.rootLogger=WARN, ROLLFILE # switch off general logging #log4cplus.rootLogger=OFF # explicitely enable loggers (even if general logging is off) #log4cplus.logger.IBHStatik=ALL, ROLLFILE #log4cplus.logger.IBHCore=ALL, ROLLFILE # setup the ROLLFILE log4cplus.appender.ROLLFILE=log4cplus::RollingFileAppender log4cplus.appender.ROLLFILE.MaxFileSize=1000KB log4cplus.appender.ROLLFILE.MaxBackupIndex=50 log4cplus.appender.ROLLFILE.layout=log4cplus::PatternLayout log4cplus.appender.ROLLFILE.layout.ConversionPattern=%d %-5p (%F:%L) - %m%n but the filename for the RollingFileAppender i will set in my application. How can i do this? Thanks Ulrich |
From: Václav Z. <vha...@gm...> - 2012-06-15 00:10:30
|
On 06/13/2012 12:34 AM, João Costa wrote: > I'm writing a library where I'd like to use log4cplus. > My library has a dependency on a third-party library ( > http://forexforums.dailyfx.com/forexconnect/392705-forexconnect-api-subscribe-updates.html > ) which also uses log4cplus. This third party is closed source and > provided in binary format only. > > > Logging from my library works correctly using ( i'm using > BasicConfigurator), however, once I instantiate an object from this > 3rd party library which also uses log4cplus, logging in my own lib > stops working ( nothing is outputted anymore). > > > Is my use case supported and expected to work ? Or maybe there is > something obvious that prevents this from working ? TBH, I have no idea. How is log4cplus linked to the Forexconnect and how is log4cplus linked to your application? I think that if you provide your own log4cplus DLL with different name than the Forexconnect one, things might work. Hmm, but I guess you would have to make sure that you do not mix your log4cplus headers and Forexconnect's log4cplus headers. Worst case, you would have to rename your log4cplus' namespace to something different to avoid conflict and recompile your log4cplus binary with this change as well. So, answer to your question seems more like no rather than yes. -- VZ |
From: João C. <joa...@zo...> - 2012-06-12 23:00:33
|
I'm writing a library where I'd like to use log4cplus. My library has a dependency on a third-party library ( http://forexforums.dailyfx.com/forexconnect/392705-forexconnect-api-subscribe-updates.html) which also uses log4cplus. This third party is closed source and provided in binary format only. Logging from my library works correctly using ( i'm using BasicConfigurator), however, once I instantiate an object from this 3rd party library which also uses log4cplus, logging in my own lib stops working ( nothing is outputted anymore). Is my use case supported and expected to work ? Or maybe there is something obvious that prevents this from working ? Thanks, Joao |
From: Václav Z. <vha...@gm...> - 2012-06-08 12:54:16
|
On 8 June 2012 13:52, Mika Laine <mik...@gm...> wrote: > Hi Václav, > > I've been using Qt4DebugAppender and all seems to work ok. No crashes, etc. > > I noticed that when using qt4debugappender there comes extra carriage > return and linefeed characters into qt creator output windows. This > does not happen when using straight qDebug- macro. Would you have any > idea where this comes from ? That depends on the Layout that you are using. By default the SimpleLayout is appending \n to the message to make one message per line. If Qt4 does that already, you will have to use custom PatternLayout for your appender instance without %n format specifier at the end of the pattern layout format. To set the layout in code do something like this: log4cplus::tstring pattern = LOG4CPLUS_TEXT("%d{%m/%d/%y %H:%M:%S,%Q} [%t] %-5p %c{2} %%%x%% - %m [%l]"); appender->setLayout(std::auto_ptr<Layout>(new PatternLayout(pattern))); To do that using properties file, use something like this: log4cplus.appender.QT=log4cplus::Qt4DebugAppender log4cplus.appender.QT.layout=log4cplus::PatternLayout log4cplus.appender.QT.layout.ConversionPattern=%d{%m/%d/%y %H:%M:%S} [%t] %-5p %c - %m The exact layout it up to you. It can be as simple as just %m specifier to get the message. -- VZ |
From: Václav Z. <vha...@gm...> - 2012-06-06 19:38:53
|
On 06/06/2012 07:30 PM, vvv jjj wrote: > Hi log4cplus-devel Team > > Regarding Unicode support, I impemented a null codeset and imbued to > file stream as mentioned in the url > (http://forums.codeguru.com/showpost.php?p=1741409&postcount=8) in > FileAppender file in FileAppender::open method. Also changed the open > mode of stream with binary option enabled in FileAppender file. > > Please let me know if the above approach has any issues. I think that it is a viable option. Personally, I would suggest using Boost's utf8_codecvt_facet, see <http://www.boost.org/doc/libs/1_49_0/libs/serialization/doc/codecvt.html>. > > Thanks > J.Viswanath > > ------------------------------------------------------------------------ > *From:* vvv jjj <vv...@ya...> > *To:* Václav Zeman <vha...@gm...> > *Cc:* "log...@li..." > <log...@li...> > *Sent:* Friday, 1 June 2012 10:21 PM > *Subject:* Re: [Log4cplus-devel] Unicode Text Logging > > Hi log4cplus Devel Team, > > Thanks Václav Zeman for the detailed explanation. > > I understood that the problem is not with log4cplus library but it is > the behavior of stream in c++. I will try the deriving the > FileAppender and check the output or may be I change the code in > log4cplus as I'm using both RollFileAppender and DailyRollFileAppender. > > Regarding the 2nd options imbue I'm using Visual Studio 2008, so need > to check if that options work or not. > > Thanks again to log4cplus team for giving good support. > > Regards > J.Viswanath > > ------------------------------------------------------------------------ > *From:* Václav Zeman <vha...@gm...> > *To:* vvv jjj <vv...@ya...> > *Cc:* log...@li... > *Sent:* Friday, 1 June 2012 6:52 PM > *Subject:* Re: [Log4cplus-devel] Unicode Text Logging > > On 31 May 2012 19:21, Václav Zeman wrote: > > On 05/31/2012 05:46 PM, vvv jjj wrote: > >> Hi log4cplus Devel Team, > >> > >> Thanks Václav Zeman. > >> > >> I gave Unicode text directly in the cpp file. (Ex: CString str = > >> _T("Ω⅓∂₤◊");) > >> The file is saved with unicode support (the default yes button when > >> Unicode file is saved in Visual Studio 2008). The configuration used > >> is Debug Unicode dynamic library. > >>[...] > I have reproduced your problem on Windows as well. The problem is > Windows problem with its code pages. > > Even though you are using the Debug_Unicode (or Release_Unicode) > configuration, which means that the output stream is std::wfstream, > the output file is always using chars (not wchar_ts). If you insist on > logging characters outside of your Windows code page, then you are > unfortunately (nearly) out of luck for 1.0.4.1. > > The best way to work around this for 1.0.4.1 would be to derive your > own appender from *FileAppender that you use and either (1) override > its append() member function to do, either wchar_t -> UTF-8 (or any > other translation) on the fly, or, if you can use Visual Studio 2010, > (2) imbue the underlying file stream with, e.g., > std::codecvt_utf8<tchar, 0x10FFFF, > static_cast<std::codecvt_mode>(std::consume_header | > std::little_endian)> facet. > > For trunk and 1.1.x branches you can do (2) using imbue() member > function on *FileAppender. > > -- > VZ -- VZ |
From: Václav Z. <vha...@gm...> - 2012-06-06 18:51:17
|
On 06/06/2012 06:28 PM, Ulrich Heinicke wrote: > Hi, > i download yesterday the version log4cplus-1.1.0-rc5 and compile all > configurations with Visual Studio 2010 without errors. Then i create a > test console program with Qt 4.8.1. In the main.cpp I write the following: > > #include <QtCore/QCoreApplication> > #include <log4cplus/logger.h> > #include <log4cplus/configurator.h> > #include <log4cplus/fileappender.h> > #include <log4cplus/layout.h> > #include <log4cplus/ndc.h> > #include <log4cplus/helpers/loglog.h> > #include <log4cplus/loggingmacros.h> > > #include <iomanip> > > using namespace std; > using namespace log4cplus; > > int main(int argc, char *argv[]) > { > QCoreApplication a(argc, argv); > > PropertyConfigurator logger(L"log4cplus.conf", > log4cplus::Logger::getDefaultHierarchy()); > logger.configure(); > Logger::getRoot().log(INFO_LOG_LEVEL, L"Projektcenter"); > > helpers::LogLog::getLogLog()->setInternalDebugging(true); > SharedAppenderPtr append_1(new > RollingFileAppender(LOG4CPLUS_TEXT("Test.log"), 5*1024, 5)); > append_1->setName(LOG4CPLUS_TEXT("First")); > append_1->setLayout( std::auto_ptr<Layout>(new TTCCLayout()) ); > Logger::getRoot().addAppender(append_1); > > Logger root = Logger::getRoot(); > Logger test = Logger::getInstance(LOG4CPLUS_TEXT("test")); > Logger subTest = Logger::getInstance(LOG4CPLUS_TEXT("test.subtest")); > > return a.exec(); > } > > I set it include path to log4cplus-1.1.0-rc5/include and add the library > log4cplus-1.1.0-rc5/msvc10/win32/bin.Debug_Unicode/log4cplusUD.lib. > But i get 4 linker errors from Visual Studio: > > 1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes > Symbol ""public: static class log4cplus::Logger __cdecl > log4cplus::Logger::getInstance(class std::basic_string<unsigned > short,struct std::char_traits<unsigned short>,class > std::allocator<unsigned short> > const &)" > (?getInstance@Logger@log4cplus@@SA?AV12@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z)" > in Funktion "_main". > 1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes > Symbol ""public: __thiscall > log4cplus::RollingFileAppender::RollingFileAppender(class > std::basic_string<unsigned short,struct std::char_traits<unsigned > short>,class std::allocator<unsigned short> > const &,long,int,bool)" > (??0RollingFileAppender@log4cplus@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@JH_N@Z)" > in Funktion "_main". > 1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes > Symbol ""public: void __thiscall log4cplus::Logger::log(int,class > std::basic_string<unsigned short,struct std::char_traits<unsigned > short>,class std::allocator<unsigned short> > const &,char const > *,int)const " > (?log@Logger@log4cplus@@QBEXHABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PBDH@Z)" > in Funktion "_main". > 1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes > Symbol ""public: __thiscall > log4cplus::PropertyConfigurator::PropertyConfigurator(class > std::basic_string<unsigned short,struct std::char_traits<unsigned > short>,class std::allocator<unsigned short> > const &,class > log4cplus::Hierarchy &,unsigned int)" > (??0PropertyConfigurator@log4cplus@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAVHierarchy@1@I@Z)" > in Funktion "_main". > > What's wrong? It is likely that Qt is compiled with wchar_t = unsigned short. You will have to recompile log4cplus with the "/Zc:wchar_t-" option. -- VZ |
From: vvv j. <vv...@ya...> - 2012-06-06 17:30:20
|
Hi log4cplus-devel Team Regarding Unicode support, I impemented a null codeset and imbued to file stream as mentioned in the url (http://forums.codeguru.com/showpost.php?p=1741409&postcount=8) in FileAppender file in FileAppender::open method. Also changed the open mode of stream with binary option enabled in FileAppender file. Please let me know if the above approach has any issues. Thanks J.Viswanath ________________________________ From: vvv jjj <vv...@ya...> To: Václav Zeman <vha...@gm...> Cc: "log...@li..." <log...@li...> Sent: Friday, 1 June 2012 10:21 PM Subject: Re: [Log4cplus-devel] Unicode Text Logging Hi log4cplus Devel Team, Thanks Václav Zeman for the detailed explanation. I understood that the problem is not with log4cplus library but it is the behavior of stream in c++. I will try the deriving the FileAppender and check the output or may be I change the code in log4cplus as I'm using both RollFileAppender and DailyRollFileAppender. Regarding the 2nd options imbue I'm using Visual Studio 2008, so need to check if that options work or not. Thanks again to log4cplus team for giving good support. Regards J.Viswanath ________________________________ From: Václav Zeman <vha...@gm...> To: vvv jjj <vv...@ya...> Cc: log...@li... Sent: Friday, 1 June 2012 6:52 PM Subject: Re: [Log4cplus-devel] Unicode Text Logging On 31 May 2012 19:21, Václav Zeman wrote: > On 05/31/2012 05:46 PM, vvv jjj wrote: >> Hi log4cplus Devel Team, >> >> Thanks Václav Zeman. >> >> I gave Unicode text directly in the cpp file. (Ex: CString str = >> _T("Ω⅓∂₤◊");) >> The file is saved with unicode support (the default yes button when >> Unicode file is saved in Visual Studio 2008). The configuration used >> is Debug Unicode dynamic library. >>[...] I have reproduced your problem on Windows as well. The problem is Windows problem with its code pages. Even though you are using the Debug_Unicode (or Release_Unicode) configuration, which means that the output stream is std::wfstream, the output file is always using chars (not wchar_ts). If you insist on logging characters outside of your Windows code page, then you are unfortunately (nearly) out of luck for 1.0.4.1. The best way to work around this for 1.0.4.1 would be to derive your own appender from *FileAppender that you use and either (1) override its append() member function to do, either wchar_t -> UTF-8 (or any other translation) on the fly, or, if you can use Visual Studio 2010, (2) imbue the underlying file stream with, e.g., std::codecvt_utf8<tchar, 0x10FFFF, static_cast<std::codecvt_mode>(std::consume_header | std::little_endian)> facet. For trunk and 1.1.x branches you can do (2) using imbue() member function on *FileAppender. -- VZ ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Log4cplus-devel mailing list Log...@li... https://lists.sourceforge.net/lists/listinfo/log4cplus-devel |
From: Ulrich H. <uhe...@ib...> - 2012-06-06 16:54:59
|
Hi, i download yesterday the version log4cplus-1.1.0-rc5 and compile all configurations with Visual Studio 2010 without errors. Then i create a test console program with Qt 4.8.1. In the main.cpp I write the following: #include <QtCore/QCoreApplication> #include <log4cplus/logger.h> #include <log4cplus/configurator.h> #include <log4cplus/fileappender.h> #include <log4cplus/layout.h> #include <log4cplus/ndc.h> #include <log4cplus/helpers/loglog.h> #include <log4cplus/loggingmacros.h> #include <iomanip> using namespace std; using namespace log4cplus; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); PropertyConfigurator logger(L"log4cplus.conf", log4cplus::Logger::getDefaultHierarchy()); logger.configure(); Logger::getRoot().log(INFO_LOG_LEVEL, L"Projektcenter"); helpers::LogLog::getLogLog()->setInternalDebugging(true); SharedAppenderPtr append_1(new RollingFileAppender(LOG4CPLUS_TEXT("Test.log"), 5*1024, 5)); append_1->setName(LOG4CPLUS_TEXT("First")); append_1->setLayout( std::auto_ptr<Layout>(new TTCCLayout()) ); Logger::getRoot().addAppender(append_1); Logger root = Logger::getRoot(); Logger test = Logger::getInstance(LOG4CPLUS_TEXT("test")); Logger subTest = Logger::getInstance(LOG4CPLUS_TEXT("test.subtest")); return a.exec(); } I set it include path to log4cplus-1.1.0-rc5/include and add the library log4cplus-1.1.0-rc5/msvc10/win32/bin.Debug_Unicode/log4cplusUD.lib. But i get 4 linker errors from Visual Studio: 1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: static class log4cplus::Logger __cdecl log4cplus::Logger::getInstance(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)" (?getInstance@Logger@log4cplus@@SA?AV12@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z)" in Funktion "_main". 1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: __thiscall log4cplus::RollingFileAppender::RollingFileAppender(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,long,int,bool)" (??0RollingFileAppender@log4cplus@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@JH_N@Z)" in Funktion "_main". 1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: void __thiscall log4cplus::Logger::log(int,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,char const *,int)const " (?log@Logger@log4cplus@@QBEXHABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PBDH@Z)" in Funktion "_main". 1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: __thiscall log4cplus::PropertyConfigurator::PropertyConfigurator(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,class log4cplus::Hierarchy &,unsigned int)" (??0PropertyConfigurator@log4cplus@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAVHierarchy@1@I@Z)" in Funktion "_main". What's wrong? Thanks Ulrich |