Questions tagged [boost-log]

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

336 questions
4
votes
1 answer

Boost Thread Access Violation in Boost Log on shutdown

I have an application that uses boost logging. During shutdown, it gets an access violation on a null pointer access. When I step through the code to the point of failure, it appears that the boost::log dll is being de-allocated and then…
JeffV
  • 52,985
  • 32
  • 103
  • 124
4
votes
2 answers

Unresolved external when using boost log

I'm having problem while trying to use boost log. I'm getting following error message: 1>------ Build started: Project: vms, Configuration: Release x64 ------ 1> main.cpp 1> Linking to lib file: libboost_system-vc140-mt-1_60.lib 1> Linking to lib…
graywolf
  • 7,092
  • 7
  • 53
  • 77
4
votes
1 answer

Implementing singletons across binary modules

Background First of all, I think this question goes beyond the C++ standard. The standard deals with multiple translation units (instantiation units) and thus multiple object modules, but does not seem to acknowledge the possibility of having…
Lingxi
  • 14,579
  • 2
  • 37
  • 93
4
votes
1 answer

Boost Log causes crash when trying first log statement (when not Administrator)

I am trying to deploy my application right now, which uses Boost Log (Boost 1.58). It is a simple console app, being run in Windows 7. Logging works perfectly fine on my personal desktop. However, when I deploy the application to a Win7 virtual…
dan-O
  • 354
  • 1
  • 10
4
votes
2 answers

Cast a boost::log::expressions::attr< std::string > to std::string

While using Boost.Log, I am trying to keep my TimeStamp formatter such as: logging::add_file_log ( keywords::file_name = "my.log", keywords::format = ( expr::stream << expr::format_date_time< boost::posix_time::ptime…
malat
  • 12,152
  • 13
  • 89
  • 158
4
votes
2 answers

How do I set std::ios_base flags like std::left in boost log 2.0?

I have an application which makes extensive use of boost log 2.0. Now I would like to set some default flags for that application like std::setprecision(std::numeric_limits::digits10 + 1), std::scientific and std::left. But how do I do that?…
niklasfi
  • 15,245
  • 7
  • 40
  • 54
4
votes
1 answer

Boost logging set output level

I was wondering if there is a something similar to FLAGS_stderrthreshold that only outputs the level that is more severe than the flag in boost library. For example, the code I have below prints everything to the console. Can I set the level so that…
JDL Wahaha
  • 695
  • 1
  • 14
  • 22
4
votes
1 answer

Boost.Log flush after each logging statement

I'm a bit new to Boost.Log library, first impressions are really good, but one thing is already took a lot of hours and I can't solve it. I want to make Boost.Log to write each message to a log file immediately. I'm aware of other questions (I, II,…
westwood
  • 1,774
  • 15
  • 29
4
votes
0 answers

How to make use of Boost.Log?

I am currently considering to use Boost.Log for logging purposes. It looks quite interesting, but I am not quite sure yet, how I am supposed to manage logger objects. As far as I can see, there are the following options: Using one global logger…
Markus Mayr
  • 4,038
  • 1
  • 20
  • 42
4
votes
2 answers

Building Boost with Boost.Log "error: target { simple_event_log.mc. } has no type"

I am trying to build Boost.Log ( http://boost-log.sourceforge.net/libs/log/doc/html/index.html ). I added it to my boost sources and executed my usual boost build command. b2 --build-dir="D:\boost\1.51.0\boost" toolset=gcc variant=release…
user14416
  • 2,922
  • 5
  • 40
  • 67
4
votes
1 answer

Boost::Log - Log with severity and custom filter attribute? Which macro(s) to use?

I want to use boost::log to let my loadtest application log to different files and to console. Each workthread (representing one user connected to the server to be tested) shall log thread log and log failed calls to failed calls log. I try to…
Rip-Off
  • 358
  • 1
  • 4
  • 14
3
votes
1 answer

How to compile Boost.Log standalone

After doing some research, partially on the Stack Overflow, I decided to try Boost.Log library by Andrey Semashev. Unfortunately, to build the Boost.Log library I have to place it in the Boost source tree and compile as it was part of the Boost. It…
Rafał Rawicki
  • 22,324
  • 5
  • 59
  • 79
3
votes
1 answer

How best to use the same Boost log throughout my C++ program?

apologies if I've missed a trick in the Boost log docs, but I'm really struggling to work out how best to use the Boost log throughout my program. I'm not a complete C++ noob, but I'm far from competent in this language....! In short: What is the…
divbot
  • 41
  • 2
3
votes
1 answer

Boost link error using Conan package manager

I encountered the following error while using the Conan version of Boost. The code compiles fine using the OS' libraries (albeit on another system). Error output: [ 2%] Built target logging [ ...] .... [ 18%] Linking CXX executable…
mattdibi
  • 641
  • 10
  • 23
3
votes
2 answers

How to test boost logger output in unit testing?

My application uses BOOST_LOG_TRIVIAL to log messages. I thought it's good to check in test (gtest) that correct messages are written there in given scenarios. Is there a way to somehow access what was written there after code was called? Or does it…
Konrad
  • 355
  • 6
  • 18