Common.Logging for TraceSource

I'm trying to adopt Common.Logging in our application, however I'm having trouble setting it up using system.diagnostics. It works with direct tracing, but not TraceSource. I used Common.Logging.Simple.TraceLoggerFactoryAdapter . Do I need another adapter for TraceSource?

+3


source to share


1 answer


It's pretty late, but maybe it will help you anyway ...

According to the Common.Logging source here , TraceLoggerFactoryAdapter supports customization in a way that uses TraceSources. The TraceLoggerFactoryAdapter has a property (which is configured in the app.config file) called "useTraceSource". If this parameter is set to true, it should force the TraceLoggerFactoryAdapter to distribute TraceLoggers that use the TraceSource internally. Note that according to the Common.Logging documentation here , "useTraceSource" is not documented.



So, you have to configure your TraceSources in the System.Diagnostics section of your app.config and tell Common.Logging to use these TraceSources by specifying the TraceLoggerFactoryAdapter and the useTraceSource property in the Common.Logging section of the app.config.

Good luck!

+2


source







All Articles