The Boost C++ library for logging, focused on simplicity, extensibility and performance
Questions tagged [boost-log]
336 questions
0
votes
2 answers
Boost Log severity levels versus syslog severity levels
I'm trying to modify my application to use the Boost Log library instead of logging into syslog. Boost Log severity levels are defined in boost/log/trivial.hpp, where the most serious level has maximal numeric number (5):
enum severity_level
{
…

HEKTO
- 3,876
- 2
- 24
- 45
0
votes
1 answer
Boost Log 1.62: filter condition must be in parentheses?
I'm working with the Boost Log library on Ubuntu 14.04 and Ubuntu 18.04. On 14.04, I'm using libboost-log1.54, while on 18.04 I'm using libboost-log1.62.
I'm using the following example code (called main.cpp):
#include…

yaobin
- 2,436
- 5
- 33
- 54
0
votes
1 answer
Boost.Log: custom action on rotation of files
Our application uses Boost.Log (1.63) and it works quite well.
We are using the rotation/archiving feature and file names with incremeting numbers.
Now we would like to watch the log files for Errors.
The monitoring software our organization uses…

Simon
- 1,616
- 2
- 17
- 39
0
votes
1 answer
Can boost log flushing be configured?
I'm using boost log and things generally seem to behave as I'd expect, except the way it flushes. I appreciate the potential value to performance from buffering and writing less frequently, but it seems like out of the box it only flushes:
With a…

firebush
- 5,180
- 4
- 34
- 45
0
votes
1 answer
No logs file getting created
I am using the example at the following link.
https://www.boost.org/doc/libs/1_57_0/libs/log/doc/html/log/detailed/utilities.html#log.detailed.utilities.setup.settings_file
My code is as follows.
#include "stdafx.h"
#include
#include…

whoami
- 1,689
- 3
- 22
- 45
0
votes
1 answer
How to organize thread safe reading from boost log sink?
I looking for a correct way to safe get text data from boost::log::sinks::text_ostream_backend.
I'm currently getting data only after everything was recorded in sink backend. I want get copy of backend internal buffer (m_ss) while data can still be…

sba
- 199
- 8
0
votes
1 answer
Doesn't boost::log respect keywords::max_size when custom collector is set?
I am using Boost 1.61 and what I ultimately want is:
Rotate current log file if its size is reaching FILE_ROTATION_SIZE
Handle the rotated file with a custom collector for further compression (is this the right way for compressing rotated…

n0p
- 713
- 10
- 23
0
votes
1 answer
TextFile Sink setting for Boost configuration file
I am using a configuration file to read the sink log settings.
My requirement is to add a configuration setting to append contents to existing log file when the process gets restarted as mentioned here using "open_mode = std::ios_base::app"
Boost…

Karthik K N
- 71
- 3
- 7
0
votes
1 answer
Boost::Log Safety of using the same backend with multiple sinks
Mine is not a real problem but more a correct usage question.
Foreword: I am using boost::log as logging facility and I am working on some libraries that will be shared among different applications and all may need different levels of logging.
I…

Maxter
- 15
- 4
0
votes
1 answer
how to add prefix for multi lines string?
Some times, the source string contain multi lines. I found no prefix since second line in log result. I don't want to split the source string to single line, have any idea?
int main()
{
BOOST_LOG_TRIVIAL(info) << "hello\nworld";
return…

liuaifu
- 147
- 1
- 8
0
votes
1 answer
Using boost::log configuration file variables
I am using the Boost 1.63.0 Log library in an application. To initialize the various log files I am making use of the boost::log::init_from_stream(...) method to configure the sinks from a configuration INI file.
I originally had an issue with the…

Peter Carta
- 3
- 2
0
votes
1 answer
boost.log auto_flush files are not stored when app is crashed
Recently I started to play with boost.log, and bumped into an issue that if an unhanded exception is thrown no log messages are written to the log file. I am using rolling text files and auto-flash option is set on.
Here is the modified source from…

Denys Nikolayenko
- 578
- 8
- 14
0
votes
1 answer
boost::log setting "Channel" attribute in a channel logger
I use several severity_channel_logger_mt instances throughout the project with different "Channel" attributes. However, for one specific log line, I'd like to set the "Channel" attribute directly in the call. Using the macro…

user23573
- 2,479
- 1
- 17
- 36
0
votes
1 answer
boost logger doesn't rotate at midnight
logging::wsettings settings;
settings["Core"]["Filter"] = L"%Severity% >= " + level;
settings["Core"]["DisableLogging"] = false;
settings["Sinks.File"]["Destination"] = L"TextFile";
settings["Sinks.File"]["FileName"] =…

user1633272
- 2,007
- 5
- 25
- 48
0
votes
1 answer
c++ - Boost.Log error with namespaces
Trying to build the next program which use Boost::library and trying to create a new logger:
#include
#include
#include
#include
class TestClass
{
... …

Serbin
- 803
- 12
- 27