Table of Contents

Enum DbContextLoggerOptions

Namespace
Microsoft.EntityFrameworkCore.Diagnostics
Assembly
Microsoft.EntityFrameworkCore.dll
[Flags]
public enum DbContextLoggerOptions

Fields

Category = 4

Includes the event DbLoggerCategory in each message. The category is included by default.

DefaultWithLocalTime = Level | Category | Id | LocalTime

The default used by LogTo(Action<string>, LogLevel, DbContextLoggerOptions?).

DefaultWithUtcTime = Level | Category | Id | UtcTime

The same defaults as used by LogTo(Action<string>, LogLevel, DbContextLoggerOptions?), but with UTC timestamps.

Id = 8

Includes the EventId in each message. The event ID is included by default.

Level = 2

Include the event LogLevel in each log message. The level is included by default.

LocalTime = 32

Includes a local time timestamp in each message. The local time is included by default.

None = 0

The raw log message with no additional metadata or formatting.

SingleLine = 1

Each event will only occupy a single line in the log. Multiple lines are used by default.

UtcTime = 16

Includes a UTC timestamp in each message. The local time is included by default. Use DefaultWithUtcTime to include all default options but change timestamps to UTC.

Remarks

See EF Core simple logging for more information and examples.