A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/api/system.data.entity.database.log below:

Database.Log Property (System.Data.Entity) | Microsoft Learn

Read in English Edit Share via

Note

Access to this page requires authorization. You can try signing in or changing directories.

Access to this page requires authorization. You can try changing directories.

Database.Log Property Definition
Namespace:
System.Data.Entity
Assembly:
EntityFramework.dll

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Set this property to log the SQL generated by the DbContext to the given delegate. For example, to log to the console, set this property to Write(String).

public Action<string> Log { get; set; }
member this.Log : Action<string> with get, set
Public Property Log As Action(Of String)
Property Value Action

<

String

>

Remarks

The format of the log text can be changed by creating a new formatter that derives from DatabaseLogFormatter and setting it with SetDatabaseLogFormatter(Func<DbContext,Action<String>,DatabaseLogFormatter>). For more low-level control over logging/interception see IDbCommandInterceptor and DbInterception.

Applies to

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.

Entity Framework

Open a documentation issue Provide product feedback Feedback

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4