Questions tagged [boost-log]

The Boost C++ library for logging, focused on simplicity, extensibility and performance

336 questions
0
votes
0 answers

Deep copy of Boost logger

How can I make a deep copy of boost::log::sources::severity_channel_logger_mt object? I need new logger instance with specified channel and copy of all attributes from source logger. using namespace boost::log; using Logger =…
sba
  • 199
  • 8
0
votes
1 answer

Extending lifetime of Boost log core

I want to extend lifetime of the boost::log::core for termination process. I know that this is not recommended in the documentation. But I tried to use Schwarz counter for core to keep it until last destructor of global variable used it. Core uses…
0
votes
1 answer

can we verify that boostlog core did remove sink?

I am using boost log to make logging system for my program. I understand boost log mechanism like this: the core singleton registers sink ,this leads to raising shared pointer count of sink by 1,then we backend raising this count to 2 in addition to…
ahmed allam
  • 377
  • 2
  • 15
0
votes
0 answers

Boost.Log: Configure flush frequency or buffer size?

I have been searching this site and the Boost.Log doc for a way to do this but have come up empty so far. The doc (https://www.boost.org/doc/libs/1_74_0/libs/log/doc/html/log/detailed/sink_backends.html) mentions the ability to set a…
Naju
  • 145
  • 2
  • 12
0
votes
1 answer

How does Boost::log print with the same indentation?

I am trying to create a log format: expr::stream << "[" << expr::format_date_time< boost::posix_time::ptime >("TimeStamp", "%Y-%m-%d %H:%M:%S.%f") << "] [" << logging::trivial::severity << "] " <<…
David Moreno
  • 141
  • 9
0
votes
1 answer

undefined reference to symbol '_ZN5boost6system15system_categoryEv'

All i found in Stackoverflow, nothing help in my case, maybe there is something that my eyes can't see? undefined reference to symbol occurs, when i include these headers #include #include…
user11841212
0
votes
1 answer

C++ boost log formater

I use boost v1.60 and I try to write a function to init and configure boost::log but I meet a weird behavior that I cannot explain. I call the following function. UPDATE: I forgot to mention that my logger is define in a DLL and that I try to push…
alexbuisson
  • 7,699
  • 3
  • 31
  • 44
0
votes
1 answer

Boost.Log change filter per channel with unknown channel names

in Boost.Log I want to set filters based on channels. Using this example I implemented using text_file_backend. But in my program, channel names are given by user as input argument. So I decided to implement a method that set severity filter for…
Jafar Gh
  • 137
  • 2
  • 12
0
votes
1 answer

Boost log wildcards for log filename

How can I customize the log file name adding the process id into it? logging::add_file_log ( keywords::file_name = "sample_%N.log", 1 keywords::rotation_size = 10 * 1024 * 1024, …
Metariku
  • 346
  • 2
  • 2
0
votes
1 answer

Is it safe to add or remove log sinks while still logging from other threads with boost log?

With boost::log is it safe to add or remove log sinks while still logging from other threads? Is there some manual locking that I need to do to make these operations thread-safe? What I am trying to do is to start a new text file that contains a…
Ian Gralinski
  • 109
  • 2
  • 13
0
votes
2 answers

Including thread name in boost log

Using boost log, I include the thread id in log messages. sink->set_formatter( expr::stream << /* other attributes */ << << expr::attr( "ThreadID") <<…
jma
  • 3,580
  • 6
  • 40
  • 60
0
votes
1 answer

boost log :using formatting_ostream to store log

i want to prepare log message and store it in something. then pass this something to function ,which apply << to this something putting it into BOOst_LOG macro. i need this because i put this log to several backends using several loggers . i read…
ahmed allam
  • 377
  • 2
  • 15
0
votes
1 answer

Boost.Log -managing repeated consecutive log messages and prevent printing duplicates

I am new to Boost.Log and Using it to develop a logger library as a wrapper on top of Boost.Log. My Problem is finding a convenient way to set a counter for number of consecutive repeated log messages instead of printing the same log multiple times.…
Jafar Gh
  • 137
  • 2
  • 12
0
votes
2 answers

Missed timestamp in Boost.Log

I'm new in Boost.Log. I'd like to print out data in the following format: [TimeStamp][Severity] Message. I have such code auto my_formatter = [](boost::log::record_view const& rec, boost::log::formatting_ostream& strm) { strm << "[" <<…
phoenix76
  • 11
  • 3
0
votes
1 answer

boost log rotate_file raise error when trying to rotate empty file?

I am using boost log and every period i manually change log file so i need to use rotate_file. when there is logs in file every thing works fine. when the file is empty but i need to close it and open next one ,rotate_file give error related to file…
ahmed allam
  • 377
  • 2
  • 15