DSAdvancedOptions ConfigureTracing Method DSWS API (.NET)

[This is preliminary documentation and is subject to change.]

Configures the diagnostics tracing

Namespace: Datastream.DswsApi
Assembly: Datastream.DswsApi.NET4.0 (in Datastream.DswsApi.NET4.0.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public void ConfigureTracing(
	SourceLevels traceLevel,
	params TraceListener[] listeners
)

Parameters

traceLevel
Type: System.Diagnostics SourceLevels
The trace level
listeners
Type:  System.Diagnostics TraceListener 
The trace listeners to write output to
Remarks

Generally the diagnostics tracing is set using the application configuration file (i.e. in app.config or web.config). However you can do this in code if you wish by calling this method. By default tracing is off.
Examples

Following example shows configuring diagnostics information in code or in the config file:
// In code 
// Configure tracing with level of information and write output to specified flat file 
// Note that you can write to any class that derives from System.Diagnostics.TraceListener
DSClient.Options.Advanced.ConfigureTracing(SourceLevels.Information, new TextWriterTraceListener(@"C:\DswsApiLogOutput.log"));

// In config
<system.diagnostics><sources><source name="DswsApi.TraceSource" switchValue="Information"><listeners><add name="fileListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\DswsApiLogOutput.log" /></listeners></source></sources></system.diagnostics>
Version Information

.NET API Framework

Supported in: 4.1, 3.6
See Also