Questions tagged [boost-log]

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

336 questions
90
votes
3 answers

Experience using Boost.Log logging library?

I am considering starting to use the Boost.Log logging library. Is anyone using Boost.Log? Please share your experiences in this regard. The other libraries I am considering are Apache log4cxx (it seems tedious to install but my team mates want…
amit kumar
  • 20,438
  • 23
  • 90
  • 126
31
votes
5 answers

What is boost log, how to get it and how to build it

So I heard good things about boost log. This claims its existence: http://boost-log.sourceforge.net/libs/log/doc/html/index.html This is the…
Cookie
  • 12,004
  • 13
  • 54
  • 83
26
votes
5 answers

Boost Log 2.0 : empty Severity level in logs

I'm using Boost-Log 2.0, which has some differences from version 1, and I have a hard time outputting the "Severity" attribute. I'm using the "Boost.Format-style" formatters "%TimeStamp% [%Uptime%] (%LineID%) <%Severity%>: %Message%" TimeStamp,…
Arthur
  • 1,974
  • 2
  • 21
  • 28
25
votes
3 answers

Boost.Log with CMake causing undefined reference error

I am trying to use the new Boost.Log library in a project I am working on. The project is built with CMake. I am receiving link errors claiming that the linker has come across undefined references to Boost.Log Linking CXX executable…
Bill D
  • 271
  • 1
  • 3
  • 6
22
votes
2 answers

Boost.Log - how to configure a text sink backend to append to rotated files

I have a sinks::text_file_backend sink. Say I already have a few rotated log files: myLog001.log, myLog002.log and so on I want the sink to keep writing to the last rotated file - myLog002.log, append to its contents and continue rotation from there…
Leo
  • 1,213
  • 2
  • 13
  • 26
22
votes
4 answers

boost log to print source code file name and line number

I'm using Boost(1.55.0) Logging in my C++ application. I have been able to generate log of this format [2014-Jul-15 10:47:26.137959]: A regular message I want to be able to add source file name and line number where the log is…
Pritesh Acharya
  • 1,596
  • 5
  • 15
  • 36
17
votes
1 answer

boost log file not written to

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). However, when I try to copy that code into a 'Logger' class, I can't…
Jarrett
  • 1,767
  • 25
  • 47
16
votes
1 answer

How to redirect Boost.Log to file

I want a simple log file in a concurrent application. I've download Boost.Log v2.0 and using compiled it with Boost 1.53.0. The problem is that Boost.Log output on console. I'm using BOOST_LOG_TRIVIAL(trace). Is there a nice way to redirect…
Elvis Dukaj
  • 7,142
  • 12
  • 43
  • 85
13
votes
4 answers

how to customize "TimeStamp" format of Boost.Log

I want to get year-month-day hour:minute:second.fraction(2 digits), if I use "%Y-%m-%d %H:%M:%S.%f", I got almost what I want exception for the fraction( last part ) of seconds, it's showing 6 digits on my Windows XP, I don't know how to get 2…
JQ.
  • 678
  • 7
  • 17
13
votes
3 answers

Avoid leak in Boost Log trivial usage

I am getting valgrind leak reports from a server side application that use boostlog that is distributed with boost 1.56. the valgrind report is : ==8021== 37,088 bytes in 1,159 blocks are definitely lost in loss record 1,613 of 1,642 ==8021== at…
Mert
  • 625
  • 1
  • 4
  • 23
12
votes
1 answer

Compilation error with Boost log library when using date_time_formatter

I'm trying to use the Boost log library, and I want to add a timestamp to the output. I started out from this example, but I ran into compilation error. I copied the code exactly as in the example, and changed the init() function to the second one…
petersohn
  • 11,292
  • 13
  • 61
  • 98
11
votes
1 answer

Boost.Log to file and stdout simultaneously?

I've used boost::log successfully to log to stdout (using the TRIVIAL macros) or to log to a file (basically following the steps in the tutorial). How would we configure to log to a file and stdout simultaneously? This is a common use case in our…
cacau
  • 3,606
  • 3
  • 21
  • 42
11
votes
1 answer

Boost log severity_logger init_from_stream

I am using boost 1.54.0. Below you can find a minimum example that illustrates my problem. I use the severity_logger of boost log. I want to configure my sinks from a stream. (In the following example I use a stringstream. In my real application the…
SebastianK
  • 3,582
  • 3
  • 30
  • 48
10
votes
1 answer

How does the "lazy evaluation" of Boost Log's trivial loggers work?

[Follows up Check boost::log filter explicitly? ] The following example uses the trivial logger from Boost Log. It outputs 1, showing that expensive() is only called once. How does it work? Why is expensive() not called? Live On Coliru #include…
Acorn
  • 24,970
  • 5
  • 40
  • 69
10
votes
3 answers

Check boost::log filter explicitly?

I have some trivial logging: BOOST_LOG_TRIVIAL(trace) << make_trace_record(); Now make_trace_record is a somewhat expensive function to call (don't ask why, it's complicated). I want to call it only if the log currently passes filtering. How can I…
n. m. could be an AI
  • 112,515
  • 14
  • 128
  • 243
1
2 3
22 23