I'm trying register DocumentDB tracing with an existing listener. The code snippet below properly traces a single message to my expected listener but not the actual traces generated by the DocumentDB C# client. Am I missing something?
Snippet from Global.asax:
private static TraceSource DocDBSource;
private static TraceListener ExistingListener = new .....;
public void RegisterDocDBListener() {
DocDBSource = new TraceSource("DocDBTrace");
DocDBSource.Switch.Level = SourceLevels.Information;
DocDBSource.Listeners.Add(ExistingListener);
DocDBSource.TraceInformation("DocDB tracing initialized");
}
According to your description, I have checked the
DefaultTracefrom DocumentDB client library for .NET as follows:For Client-side Logging with the .NET DocumentDB Client Library, you could configure the
system.diagnosticsconfiguration as follows to collect and persist documentdb log messages to a text file as follows:Note: The default Log Level is Information, you could change the
ClientSwitchto your expected Log Level (Off, Error, Information, Verbose).Result