Note that there are some explanatory texts on larger screens.

plurals
  1. POGood logging library for managed/unmanaged application?
    text
    copied!<p>What logging library or approach would you recommend for this case:</p> <ul> <li>We want to be able to log both from managed and unmanaged code</li> <li>For the unmanaged code, the implementation should not cross back into managed code, because this could cause our unmanaged threads to get 'caught' during a garbage collection.</li> <li>Performance is a concern</li> </ul> <p><a href="http://www.nlog-project.org/" rel="nofollow noreferrer">NLog</a> provides a "C" api, but implements it in terms of its managed implementation. </p> <p>Many of the C logging libraries out there (<a href="http://www.arg0.net/rlog" rel="nofollow noreferrer">rlog</a>, <a href="http://code.google.com/p/google-glog/" rel="nofollow noreferrer">glog</a>) are reliant on macros + preprocessing and are not amenable to wrapping with .NET without extensive modification.</p> <p>I guess I'm looking for something with a native/unmanaged logging core, but a decent .NET managed api as well. Does this exist? If this doesn't exist, what comes the closest?</p> <p>Followup - Thanks for the responses mentioning log4net. I think Log4Net and NLog both perform ok in a pure managed application, -but-... The app I've been asked to build has unmanaged I/O on a background thread that absolutely cannot afford to be stopped by a garbage collection. If unmanaged c++ code has to call "up" into a managed logger, it stands a chance of being frozen for 200 or even 2000 milliseconds while the garbage collection occurs. That's why I'm looking for a library that is unmanaged at its core. - Dave</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload