unofficial implementation for bridging Npgsql.Logging to DiagnosticSource
- add nuget package to your project.
- subscribe events via
System.Diagnostics.DiagnosticListener.AllListeners
- set
Unofficial.Npgsql.Logging.DiagnosticNpgsqlLoggingProvider
toNpgsql.Logging.NpgsqlLogManager.Provider
.
This library provides following DiagnosticSource
DiagnosticSource named Npgsql.Logging.[Npgsql logger name]
.
Npgsql.Logging.[Npgsql logger name]
produces following events.
event name | when | argument type |
---|---|---|
Log | emitted log from Npgsql.Logging.NpgsqlLogger | Unofficial.Npgsql.Logging.LogEventArgs |
CreateLogger | first time of creating NpgsqlLogger instance | Unofficial.Npgsql.Logging.CreateLoggerEventArgs |
This library provides DiagnosticSource named Npgsql.Logging
.
Npgsql.Logging
produces following events.
event name | when | argument type |
---|---|---|
Log.[Npgsql logger name] | emitted log from Npgsql.Logging.NpgsqlLogger | Unofficial.Npgsql.Logging.LogEventArgs |
CreateLogger | first time of creating NpgsqlLogger instance | Unofficial.Npgsql.Logging.CreateLoggerEventArgs |
LogEventArgs
is the class which has following members.
name | type |
---|---|
Level | NpgsqlLogLevel |
Message | string |
ConnectorId | int |
Exception | Exception |
`CreateEventLoggerArgs is the class which has following members.
name | type |
---|---|
Name | string |
Level | NpgsqlLogLevel |
change DiagnosticSource name convention destructively(Npgsql.Logging
to Npgsql.Logging.[Npgsql logger name]
) and event name(Log.[Npgsql logger name]
to Log
)
first release