Headers to #include

When declaring the loggers

If you want to log a message using a certain logger, that logger needs to be declared.

#include <boost/logging/format/named_write_fwd.hpp>

#include <boost/logging/format_fwd.hpp>

#include <boost/logging/logging.hpp>

// when you log messages on a dedicated thread (see writer::on_dedicated_thread class)
#include <boost/logging/writer/on_dedicated_thread.hpp> 

When defining/initializing the loggers

If you want to construct the logger, or to initialize it, the logger needs to be defined. In other words, the corresponding logger class needs to be defined.

#include <boost/logging/format/named_write.hpp>

#include <boost/logging/format.hpp>

#include <boost/logging/formatter/tags.hpp>

#include <boost/logging/logging.hpp>

An Example - the starter project

Note that usually you'll have a header file of your own, where you declare the logs. And a source file where you define and initialize your logs. You can take a look at the starter project.

Copyright John Torjo © 2007
Have a question/ suggestion/ comment? Send me feedback