0

How to direct logs to multiple log files (destinations) – log4cpp

Posted by Joys of Programming on January 15, 2010 in C/C++

log4cpp can not only be used to log the events to a log file or standard output, but also helps you to log events to multiple destinations. For this purpose, either you can add multiple appenders to a single category or make use of multiple Categories. We will explore the first options. With this option, [...]

Tags: , , , , , , , , , , ,

 
0

log4cpp: Logging Events and Priorities

Posted by Joys of Programming on January 14, 2010 in C/C++

The most important aspect of a log message is its priority. Take a simple scenario, when you are debugging your program, you want to display all the logs in your program. At that moment, you are not concerned about the resource crunch and performance impact. But when your program is running, you do not want [...]

Tags: , , , , , , , , ,

 
0

log4cpp::PropertyConfigurator – Configure with configuration files

Posted by Joys of Programming on January 14, 2010 in C/C++

log4cpp can also be configured with the configuration files. log4cpp::PropertyConfigurator can be used for this purpose. It has a single function which takes as input the configuration file. void configure (const std::string &initFileName) Simply specify the configuration in a file. You must specify the layout, priority and the appender in the configuration file as shown [...]

Tags: , , , , , ,

 
0

How to install log4cpp from sources?

Posted by Joys of Programming on January 14, 2010 in C/C++

log4cpp is used for logging purposes in C++. To install log4cpp in Linux is as simple as installing some simple packages like liblog4cpp5 and liblog4cpp5-dev. But if you want to install log4cpp from sources, you need to follow the following procedures. Using these steps, you can easily install log4cpp in Mac and Linux (or any [...]

Tags: , , , , , , , ,

 
0

How to Compile and link log4cpp programs?

Posted by Joys of Programming on January 14, 2010 in C/C++

log4cpp, used for logging in C++ can be installed from packages or from the source code. But while programming with log4cpp, you must be aware of certain aspects like the location of the log4cpp headers and log4cpp library. The simplest way to find out the location of the headers $ log4cpp-config –cflags -I/usr/local/include -O2 -DNDEBUG [...]

Tags: , , , ,

 
0

log4cpp::BasicLayout – Log Format with Additional Information

Posted by Joys of Programming on January 13, 2010 in C/C++

The Log4cpp SimpleLayout is the simplest log layout with the format “priority message”. But for regular usage, you need more information especially information like the timestamp. log4cpp::BasicLayout has the following Layout timeStamp priority category ndc: message where timestamp corresponds to the timestamp when the message was generated, priority corresponds to the type of the logging  [...]

Tags: , , , ,

 
0

Three Important Steps for Log4cpp Programming

Posted by Joys of Programming on January 12, 2010 in C/C++

When you start working with log4cpp, you need to take care of the following steps Initializing an Appender Deciding on the Layout Finalize on the Category Let’s see what each of these mean. Appender: Appender in log4cpp corresponds to the destination of logs. A suitable appender is initialized based on your requirements. The destination of [...]

Tags: , , , , , ,

Pages: 1 2 Next

Copyright © 2009-2010 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.7.2 theme from BuyNowShop.com.