다음을 통해 공유


DbContextLoggerOptions Enum

Definition

Formatting options for use with Microsoft.EntityFrameworkCore.Diagnostics.Internal.FormattingDbContextLogger and LogTo(Action<String>, LogLevel, Nullable<DbContextLoggerOptions>).

This enumeration supports a bitwise combination of its member values.

[System.Flags]
public enum DbContextLoggerOptions
[<System.Flags>]
type DbContextLoggerOptions = 
Public Enum DbContextLoggerOptions
Inheritance
DbContextLoggerOptions
Attributes

Fields

Name Value Description
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.

Level 2

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

Category 4

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

Id 8

Includes the EventId in each message. The event ID is included 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.

DefaultWithUtcTime 30

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

Includes Level, Category, Id, UtcTime.

LocalTime 32

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

DefaultWithLocalTime 46

The default used by LogTo(Action<String>, LogLevel, Nullable<DbContextLoggerOptions>).

Includes Level, Category, Id, LocalTime.

Remarks

See EF Core simple logging for more information and examples.

Applies to