Skip to content

Commit 717c3ec

Browse files
committed
Add more log4net logging documentation.
1 parent dbe7786 commit 717c3ec

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/content/overview/logging.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ the existing logging framework, and install it by setting `MySqlConnector.Loggin
1616

1717
The `MySqlConnectorLogManager.Provider` property may only be set once, and must be set before any other MySqlConnector library methods are called.
1818

19+
Debug-level logging is useful for diagnosing problems with MySqlConnector itself; it is recommend that applications limit MySqlConnector
20+
logging to Info or higher.
21+
1922
### Existing Logging Providers
2023

2124
There are NuGet packages that adapt MySqlConnector logging for popular logging frameworks.
@@ -30,6 +33,16 @@ Add the following line of code to your application startup routine:
3033
MySqlConnectorLogManager.Provider = new Log4netLoggerProvider();
3134
```
3235

36+
To reduce the verbosity of MySqlConnector logging, add the following element to your log4net config:
37+
38+
```xml
39+
<log4net>
40+
...
41+
<logger name="MySqlConnector">
42+
<level value="WARN" /> <!-- or "INFO" -->
43+
</logger>
44+
```
45+
3346
#### Microsoft.Extensions.Logging
3447

3548
Install [MySqlConnector.Logging.Microsoft.Extensions.Logging](https://www.nuget.org/packages/MySqlConnector.Logging.Microsoft.Extensions.Logging/).

0 commit comments

Comments
 (0)