We rely on the SmartConnect 21 WCF Web Services in our system.
We recently noticed that the file c:\temp\eOne.SmartConnect.Wcf.LibraryErrors.log is very large, so we have to periodically delete the file to save space on our system.
What is this file used for, and is it possible to stop it from logging anything?
If you’d like to watch the video that goes along with this article, see below or click here.
eOne.SmartConnect.Wcf.LibraryErrors.log
This is a trace file created by settings in the SmartConnect WCF Web.config file for a “Text File Listener” and is set to the “Best Practice” defaults.
Out of the box, the eOne SmartConnect installer sets the value to “Information, ActivityTracing” for the System.Service event listener and sets the InitializeData path to c:\temp\eOne.SmartConnect.Wcf.LibraryErrors.log.

The full list of values can be found from the Microsoft Learn site and are:
<sources>: Defines which components will generate trace data. Each source has a switchValue that controls the minimum trace level to capture. The possible values are defined by the SourceLevels enumeration:
Off: Tracing is disabled.Critical: Logs only critical errors.Error: Logs critical errors and all other errors.Warning: Logs critical errors, all other errors, and warnings.Information: Logs all the above, plus informational messages.Verbose: Logs all the above, plus detailed messages.ActivityTracing: Captures start, stop, suspend, resume, and transfer events to track logical operations. This is key for E2E tracing
Out of the box, the trace events logged are difficult to read – using a tool like Windows SDK Microsoft Service Trace Viewer makes it more readable.

If we didn’t need this level of tracing (or setting to more information by changing the switch level), we can turn it off entirely by changing the SwitchValue to “Off” per the highlighted section in the screenshot below and also adding that same setting to the System.ServiceModel.MessageLogging section.

Once the web.config is modified, you would need to Stop & Start the application pool for the SmartConnectWcf Web Services and IIS/SmartConnect will no longer write to this file.