-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathDbLoggerCategory.cs
93 lines (81 loc) · 3.4 KB
/
DbLoggerCategory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.EntityFrameworkCore;
/// <summary>
/// An API for getting logger categories in an Intellisense/tab-completion friendly manner.
/// </summary>
/// <remarks>
/// <para>
/// Get an Entity Framework Core logger category using its Name property. For example,
/// <c>LoggerCategory.Database.Sql.Name</c>.
/// </para>
/// <para>
/// Use these types with <see cref="IDiagnosticsLogger{TLoggerCategory}" /> or
/// <see cref="IDiagnosticsLogger{TLoggerCategory}" /> to create a logger.
/// </para>
/// <para>
/// See <see href="https://aka.ms/efcore-docs-diagnostics">Logging, events, and diagnostics</see> for more information and examples.
/// </para>
/// </remarks>
public static class DbLoggerCategory
{
/// <summary>
/// The root/prefix for all Entity Framework categories.
/// </summary>
public const string Name = "Microsoft.EntityFrameworkCore";
/// <summary>
/// Logger categories for messages related to database interactions.
/// </summary>
public class Database : LoggerCategory<Database>
{
/// <summary>
/// Logger category for messages related to connection operations.
/// </summary>
public class Connection : LoggerCategory<Connection>;
/// <summary>
/// Logger category for command execution, including SQL sent to the database.
/// </summary>
public class Command : LoggerCategory<Command>;
/// <summary>
/// Logger category for messages related to transaction operations.
/// </summary>
public class Transaction : LoggerCategory<Transaction>;
}
/// <summary>
/// Logger category for messages related to <see cref="DbContext.SaveChanges()" />, excluding
/// messages specifically relating to database interactions which are covered by
/// the <see cref="Database" /> categories.
/// </summary>
public class Update : LoggerCategory<Update>;
/// <summary>
/// Logger categories for messages related to model building and metadata.
/// </summary>
public class Model : LoggerCategory<Model>
{
/// <summary>
/// Logger category for messages from model validation.
/// </summary>
public class Validation : LoggerCategory<Validation>;
}
/// <summary>
/// Logger category for messages related to queries, excluding
/// the generated SQL, which is in the <see cref="Database.Command" /> category.
/// </summary>
public class Query : LoggerCategory<Query>;
/// <summary>
/// Logger category for miscellaneous messages from the Entity Framework infrastructure.
/// </summary>
public class Infrastructure : LoggerCategory<Infrastructure>;
/// <summary>
/// Logger category for messages from scaffolding/reverse engineering.
/// </summary>
public class Scaffolding : LoggerCategory<Scaffolding>;
/// <summary>
/// Logger category messages from Migrations.
/// </summary>
public class Migrations : LoggerCategory<Migrations>;
/// <summary>
/// Logger category for messages from change detection and tracking.
/// </summary>
public class ChangeTracking : LoggerCategory<ChangeTracking>;
}