Filters
Filters decide whether a message passes through. Add them with Log.Container.AddFilter().
Multiple filters use AND logic (all must pass).
| Filter | Description |
|---|---|
LevelFilter(minLevel) |
Pass messages at or above a level |
LevelRangeFilter(min, max) |
Pass messages within a level range |
ClassFilter(classes[], minLevel, exclude) |
Filter by class name |
NamespaceFilter(name, minLevel, recursive) |
Filter by namespace |
DirectoryFilter(path, includeSubdirs) |
Filter by source directory |
PathFilter(predicate) |
Custom predicate on file path |
RegexFilter(pattern, options, includeMatch) |
Filter by regex on message text |
RateLimitFilter(max, interval, key, mode) |
Limit message frequency |
TimeWindowFilter(start, end, days) |
Filter by time of day / day of week |
ChainedFilter(filters[]) |
AND-combine filters |
CompositeFilter(mode, filters[]) |
AND or OR-combine filters |
Log.Container.AddFilter(new LevelFilter(LogLevel.Warning));
Log.Container.AddFilter(new RegexFilter("error|fail", RegexOptions.IgnoreCase));
Log.Container.AddFilter(new ClassFilter(new[] { "Player" }));
Log.Container.AddFilter(new RateLimitFilter(5, TimeSpan.FromSeconds(10)));
Log.Container.AddFilter(new TimeWindowFilter(
start: TimeSpan.FromHours(9), end: TimeSpan.FromHours(17)));