Is it possible to filter out specific log message?
We're using Orleans dashboard, and the log stream view it provides.
Orleans dashboard polls Orleans a lot for stats, and that grain logs an info for every call which makes our log stream look like this:

is there a way to provide a function or regex or something to filter it out?
In 1.x you can configure different log level for different sources via ITraceConfiguration.TraceLevelOverrides.
For 2.0 @xiazen can explain.
In 2.0, Orleans fully integrated with Microsoft.Extensions.Logging. You can configure log filters with the your ILoggingBuilder to filter out those messages. For how to do it , please refer to their latest doc
Hi, I ported the dashboard to 2.0. The implementation is done by registering a custom logger and we have to filter it there. Just create an issue. But besides that I am not sure how helpful the log stream is, because it has 2 problems:
- Log messages are not persistent.
- Log stream shows only a single silo.
For production I would push all log messages to graylog or kibana or another tool and view it there.
Yeah the question wasn't dashboard specific, but i guess we could always filter out whatever we want in a custom log consumer before forwarding to a ELK.
Regarding the dashboard, log stream is useful for quickly looking at the cluster state, we use it mostly in development to debug stuff etc. this pull request should also be enough, it allows regex filtering in the log stream UI. https://github.com/OrleansContrib/OrleansDashboard/pull/84
MEL log filters filter messages based on the logger's category name. So it will work if the log message is not persistent, I assume you are filtering messages based on log message content and failed because of the non-persistence?
But I kind of lost context when the OrleansDashboard conversation comes up, and the Log stream you guys are mentioning. Is this issue specific related to OrleansDashboard? what kind of ILoggerFactory or Log stream is used there?
Yeah i kind of mixed a couple of things, Ill clarify. I wanted to filter out certain messages in general in orleans so i wouldnt log them to log consumers , orleans dashboard being just on of them. I concluded that i can do that filtering in the log consumers themselves in my case.
But still, the main thing was how to filter out messages in orleans. Im good with your answer, this is not an issue anymore.