DataContext.Log property

Gets or sets an object that will write the Collaborative Application Markup Language (CAML) query that results from the translation of the LINQ query.

Namespace:  Microsoft.SharePoint.Linq
Assembly:  Microsoft.SharePoint.Linq (in Microsoft.SharePoint.Linq.dll)

Public Property Log As TextWriter
Dim instance As DataContext
Dim value As TextWriter

value = instance.Log

instance.Log = value

Property value

Type: System.IO.TextWriter
A TextWriter that can be called to write the CAML query.

The following example shows how to set the Log property to write the CAML queries to the console in a console application:

Dim dc As New DataContext("http://localhost")
dc.Log = Console.Out