Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Database::Log Property

Entity Framework 6.0
 

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.

Namespace:   System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

public:
property Action<String^>^ Log {
	Action<String^>^ get();
	void set(Action<String^>^ value);
}

Property Value

Type: System::Action<String^>^

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

Return to top
Show: