Questions tagged [boost-log]

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

336 questions
3
votes
1 answer

Linkage error with Boost Log 1.65.0 example from the Boost.org

I tried to build this example and got a linkage error: hekto@ubuntu:~$ g++ -g -Wall -std=c++11 -pthread -DBOOST_LOG_DYN_LINK -pthread sample.cpp -o sample -lboost_log -lboost_thread -lboost_system /tmp/cc2EUizv.o: In function…
HEKTO
  • 3,876
  • 2
  • 24
  • 45
3
votes
1 answer

Set custom filters for boost log sink with custom attribute & severity level

I have a log setup in which I have 2 types of log messages: 1 based solely on severity level 1 based solely on a custom tag attribute These attributes are defined as follows: BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity",…
ThaMe90
  • 4,196
  • 5
  • 39
  • 64
3
votes
0 answers

Boost.log: reset log rotation counter, when filename changes on midnight

I use a textfile backend for a sink, which contains to placeholder elements date log-rotation counter "%Y-%m-%d_mylogfile_%3N.log" Furthermore, the backend is configured to rotate at a certain size and at midnight. using namespace…
nils
  • 61
  • 4
3
votes
2 answers

How to query boost::log severity?

I'm using trivial logging of boost::log library and I want to execute some code depending on currently set logger severity. This is needed for constructing of log message only if it will be outputted. But I cannot find the right way for querying…
bobeff
  • 3,543
  • 3
  • 34
  • 62
3
votes
1 answer

boost log text_file_backend performance

I am using boost log and I choose the text_file_backend, but I got bad performance. No matter sync or async, the boost log has a low performance. About in 6 seconds, it wrote 30M data to log file. Follow is my code snippet, anyone can help me? …
Nature.Li
  • 345
  • 1
  • 3
  • 11
3
votes
1 answer

Use of Boost.Log and Boost.ASIO causes a crash

I am running into an issue where the use of Boost.Log in an app causes a crash or a hang when the app loads a shared library that uses Boost.ASIO! Any insights would be appreciated; a full cmake-buildable example is below. If the declaration of the…
James
  • 9,064
  • 3
  • 31
  • 49
3
votes
3 answers

BOOST_LOG_TRIVIAL ( severity ) << ... does not redirect to a file

We are using the simplest version of boost.log v2 with BOOST_LOG_TRIVIAL ( severity ) << ... For the moment we would not like to create a separate sink or output file, sometimes redirecting the console output to a file is good enough for our…
filimon
  • 61
  • 4
3
votes
1 answer

Segmentation fault on using boost syslog and cpp-netlib

After adding boost syslog into source code, segmentation fault appears inside cpp-netlib library. I was able to prepare minimum working code snippet to reproduce the problem. #include #include…
cdovgal
  • 326
  • 3
  • 10
3
votes
1 answer

How to set open_mode for a boost sink (non global) to append

Currently I'm using sinks for writing data to log files and standard otput. Unfortunately if I restart my application the sink will not append the new entries to the log file. It overrides the existing data. My Code is the following: using…
little_planet
  • 1,005
  • 1
  • 16
  • 35
3
votes
2 answers

How do I set the boost logging severity level from config?

I would like to be able to specify the logging severity level from config: # my config file LogSeverity = info How can I do this? Currently I've got something like this in my main function: // logging settings boost::log::trivial::severity_level…
quant
  • 21,507
  • 32
  • 115
  • 211
3
votes
2 answers

Boost Log to File not working

I can't figure out why this example code doesn't work right. My compiler says that the functions being called are not members of the declared namespace. This is the example code for Boost log so why doesn't it work? What do I need to do? I've…
HSchmale
  • 1,838
  • 2
  • 21
  • 48
3
votes
1 answer

Boost Logging displays linux thread ids as all 0s

I am trying to send log strings to a file in the latest version of boost 1.57 and for some reason on linux, the thread IDs are always set to 0's. I have a feeling that it may have something to do with using native threads instead of boost threads…
johnco3
  • 2,401
  • 4
  • 35
  • 67
3
votes
1 answer

How to use a compressor Boost::Iostreams filter as a sink in Boost::Log

I'm trying to compress log files created using the Boost Log library instantaneously by utilizing boost::iostreams::gzip_compressor. So when I call BOOST_LOG(), output gets compressed on-the-fly. Here's what I tried so far: #include…
seldak
  • 281
  • 3
  • 12
3
votes
1 answer

Different boost log sinks for every class

I am new to boost log. My algorithm has 4 main steps and I want the logging for every step in one file. So that I have 4 sinks. My idea is that I can change the sink on every step. Is that possible? At the moment I have my looger.h with a global…
Hunk
  • 479
  • 11
  • 33
3
votes
1 answer

Boost Log V2 Library Android Linking

I am trying to build Boost 1.55 Log v2 library on Android using NDK 9C. I have used the patches and build the boost using build-android.sh including thread,iostreams,random and log options. I have used the other features of Boost and they have…
guven
  • 41
  • 5