Boost C++ Libraries: Ticket #10638: unhandled exception in async sink, created by init_from_settings https://svn.boost.org/trac10/ticket/10638 <p> when settings file describes async file sink pointing to inaccessible location, async sink will be created without exception handler and will throw unhandled exception from async thread, killing application. easiest way to fix it is to add exception suppressor to async sinks, created by init_from_settings. i.e. </p> <pre class="wiki"> else { p = init_formatter(boost::make_shared&lt; sinks::asynchronous_sink&lt; backend_t &gt; &gt;(backend), params, is_formatting_t()); p -&gt; set_exception_handler ( make_exception_suppressor ( ) ); } </pre><p> instead of </p> <pre class="wiki"> else p = init_formatter(boost::make_shared&lt; sinks::asynchronous_sink&lt; backend_t &gt; &gt;(backend), params, is_formatting_t()); </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10638 Trac 1.4.3 Andrey Semashev Thu, 09 Oct 2014 14:12:39 GMT <link>https://svn.boost.org/trac10/ticket/10638#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10638#comment:1</guid> <description> <p> You can register your own sink factory and configure the sink the way you need. The default factory doesn't set any exception handler because there is no good default one. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 09 Oct 2014 14:27:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10638#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10638#comment:2</guid> <description> <p> well, registering new factories will mean reimplement/copypaste all init_from_settings.cpp. btw we are not talking about default behavior, we are talking about the behavior, since it is impossible to add/change exception handler afterwards afaik. the only other way to change exception handler is ... to register new factories, which will not use code in question anyway. to me it looks like suppressing exception is much better than just killing application. we are talking about suppressing only those exceptions which otherwise will kill application. basically my suggestion boils down to "suppress instead of dying", i fail to see downsides. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sun, 12 Oct 2014 11:07:51 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/10638#comment:3 https://svn.boost.org/trac10/ticket/10638#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> You have a point. Fixed in <a class="ext-link" href="https://github.com/boostorg/log/commit/4cb6d0ca7dbe611a68ce002360e621995446b534"><span class="icon">​</span>https://github.com/boostorg/log/commit/4cb6d0ca7dbe611a68ce002360e621995446b534</a>. Thanks for the report. </p> Ticket