We are using Boost.Log v2 (1.70) in our application which is available for Windows and Linux. Recently I refactored a dynamically loaded dll to also use Boost.Log.
The dll exports C api functions to access dedicated hardware. It is used in various programming environments: C, C++, Python, Delphi and also Labview. (Most of them not using Boost.Log).
For Windows the dll is build to only use static libaries and to use a static runtime, making deployment much easier.
This works as expected: Both boost log instances seem to be fully independent of each other. The app logs into its file sink, the dll into another one.
On Linux the plugin is build to use shared runtime and shared boost libraries. We made this intentionally to be able to use the Linux distributions boost libraries.
The effect is that after plugin load the application no longer logs into its sink. We are seeing logs from the plugin instead. As the api dll is not aware that there may be others also using Boost.Log (== the same instance), it calls boost::log::core::get()-> remove_all_sinks() on logging reconfigurations.
Would it be possible to go a similar route (like in Windows) and to try to build the plugin using static linking and a static runtime?
Or is this approach doomed?
Though currently working, is using a static runtime + static linking Boost.Log a viable build configuration for Windows?
Thanks in advance, Gunther