DatabaseLogger Class
Definition
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.
A simple logger for logging SQL and other database operations to the console or a file. A logger can be registered in code or in the application's web.config /app.config file.
public class DatabaseLogger : IDisposable, System.Data.Entity.Infrastructure.Interception.IDbConfigurationInterceptor
type DatabaseLogger = class
interface IDisposable
interface IDbConfigurationInterceptor
interface IDbInterceptor
Public Class DatabaseLogger
Implements IDbConfigurationInterceptor, IDisposable
- Inheritance
-
DatabaseLogger
- Implements
Constructors
DatabaseLogger() |
Creates a new logger that will send log output to the console. |
DatabaseLogger(String, Boolean) |
Creates a new logger that will send log output to a file. |
DatabaseLogger(String) |
Creates a new logger that will send log output to a file. If the file already exists then it is overwritten. |
Methods
Dispose() |
Stops logging and closes the underlying file if output is being written to a file. |
Dispose(Boolean) |
Stops logging and closes the underlying file if output is being written to a file. |
StartLogging() |
Starts logging. This method is a no-op if logging is already started. |
StopLogging() |
Stops logging. This method is a no-op if logging is not started. |
Explicit Interface Implementations
IDbConfigurationInterceptor.Loaded(DbConfigurationLoadedEventArgs, DbConfigurationInterceptionContext) |
Called to start logging during Entity Framework initialization when this logger is registered. as an IDbInterceptor. |
Applies to
Entity Framework