The Boost C++ library for logging, focused on simplicity, extensibility and performance
Questions tagged [boost-log]
336 questions
2
votes
2 answers
Boost log and dynamically loaded libraries
We are using Boost.Log v2 (1.70) in our application which is available for Windows and Linux. Recently I refactored a dynamically loaded dll to also use Boost.Log.
The dll exports C api functions to access dedicated hardware. It is used in various…

Gunther
- 374
- 2
- 10
2
votes
0 answers
Boost.Log Expressions v1.71 will not compile under C++20
Including the header under C++20 (only tested under gcc 10.1), causes a compilation failure:
/celibs/boost_1_71_0/boost/log/attributes/named_scope.hpp:128:29: error: 'reference' in…

cmannett85
- 21,725
- 8
- 76
- 119
2
votes
0 answers
Boost 1.73 log library regression
I recently upgraded from Boost 1.72 to 1.73. For some reason the boost::log library seems to have some regression and I cannot find a solution from looking over the source code and investigating example program deltas from the previous version…

johnco3
- 2,401
- 4
- 35
- 67
2
votes
1 answer
boost log file cannot create sample.log file
I've been struggling with boost log for a while now - I got their simple example writing to a log file (http://boost-log.sourceforge.net/libs/log/example/doc/tutorial_file.cpp).The problem is when I use this part of the code
...
void init()
{
…

Mohsen Ghahremani Manesh
- 353
- 3
- 13
2
votes
1 answer
boost::log is it possible rotate file every time applicaion run?
Let's consider example from boost::log doc.
void init()
{
logging::add_file_log
(
keywords::file_name = "sample_%N.log",
keywords::rotation_size = 10 * 1024 * 1024,
keywords::open_mode = (std::ios::out |…

Viktor
- 1,004
- 1
- 10
- 16
2
votes
2 answers
How can I set a severity level per log source with Boost log?
I am new to Boost Log, and having troubles doing some pretty simple stuff.
I'm trying to create a logger and assign a level to it (such as Warning, Info, Trace, etc.), and filter out(for performance reasons) any logs sent to this logger with a lower…

omer
- 1,242
- 4
- 18
- 45
2
votes
2 answers
Using boost::log in parallel environment
I ran the following code with two processes. In the output, there is only one entry. I get a different rank every time. Seems like each process overwrites the file. How can I make all processes to log a message without overwriting?
Expected result…

Shibli
- 5,879
- 13
- 62
- 126
2
votes
1 answer
c++ boost log positional(indexed) format alignment
Im trying to format the boost log output such that a field of choice will always be of a specific width for output log alignment reasons.
add_file_log(
keywords::file_name = s.str(),
keywords::rotation_size = log_info.log_file_size,
…

Eli Sikuriansky
- 21
- 1
2
votes
1 answer
Set both severity and channel for each record
I am using the combined severity and channel logger to get some kind of scope to the logging output.
The problem is that I want to use a single logging object for my whole project, and therefore want to be able to set the channel for a specific…

Some programmer dude
- 400,186
- 35
- 402
- 621
2
votes
2 answers
How to use Boost.Log formatting expressions in custom formatting function
I am trying to use a custom formatter with Boost.Log. The way I know how to do this is to call the set_formatter method of a sink giving it the address of a local function where the signature of the local function needs to be:
void…

Phil
- 5,822
- 2
- 31
- 60
2
votes
1 answer
How to stop all asynchronous sinks when using Boost.Log
I am using Boost.Log asynchronous sinks (see Asynchronous sink frontend). To have a proper shutdown, one must gracefully stop and flush the feeding of records to the async sinks. The core has methods for adding and removing sinks, but there does not…

Phil
- 5,822
- 2
- 31
- 60
2
votes
1 answer
Can we create each boost logger instance for each class object?
I have using boost log for past three months. I am using boost logger as static in inside the class.
BoostLogger.h:
class CBoostLogger
{
private:
SharedPtr< SinkFileBackend > backend;
...
public:
static src::wseverity_logger_mt<…

Arun kumar Kalaiarasan
- 286
- 4
- 15
2
votes
1 answer
Boost Logger Static Linking: Not Working
I have a Qt application that uses the boost logger library. I want to make it a standalone. However, after I managed the libraries for static linking, the application is still dependent on boost libraries.
The libraries that I included are:
…

D.Badawi
- 175
- 1
- 13
2
votes
0 answers
SIGSEGV on program exit with boost::log
Some time ago we separate our big project with almost static libraries to many projects with dynamic libraries.
Since then we stated seeing problems on shutdown.
Sometimes, the process would not terminate. With gdb I found, that on object…

ForEveR
- 55,233
- 2
- 119
- 133
2
votes
1 answer
Cannot set format of console log in Boost.Log
I'm trying to setup boost.log into a project I have. I've followed the examples, but when I try to set a format, the compiler says that format is a read-only reference.
void init() {
logging::add_console_log(
std::cout,
//…

Jazzwave06
- 1,883
- 1
- 11
- 19