You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-4Lines changed: 25 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,15 @@ public override Task<HTTPResponse> HandleRequest(HTTPRequest request, Grpc.Core.
132
132
133
133
### Logging
134
134
135
-
Plugins that extend `BasePlugin` have access to an `ILogger` instance via the `Logger` property. This allows plugins to emit structured logs that appear in the host application's output.
135
+
Plugins that extend `BasePlugin` have access to an `ILogger` instance via the `Logger` property. The SDK automatically provides a default logger that outputs logs in a format compatible with mcpd's log level inference:
136
+
137
+
```
138
+
[INFO] Plugin server listening on unix /var/...
139
+
[WARN] Rate limit exceeded
140
+
[ERROR] Failed to process request
141
+
```
142
+
143
+
This format allows mcpd to properly categorize log messages by severity.
136
144
137
145
```csharp
138
146
usingMicrosoft.Extensions.Logging;
@@ -142,13 +150,13 @@ public class MyPlugin : BasePlugin
@@ -157,7 +165,20 @@ public class MyPlugin : BasePlugin
157
165
}
158
166
```
159
167
160
-
The SDK automatically suppresses ASP.NET Core framework logs at the Info level to reduce noise. Plugin logs at Info level and above will appear normally in the host application's output.
168
+
For advanced scenarios, you can provide your own logger:
0 commit comments