If you want to move to semantic logging in general, not just the SLAB implementation, you might find it easier to move to Serilog. (Disclaimer - I started the project, though it's now well-established).
Serilog implements the same semantic logging concepts as EventSource
and friends, but uses the classic "ILogger"-style API you get from Castle.
log.Information("The cart contains {CartSize} items", cart.Count);
This example associates a structured property called CartSize
with the event, just as you'd get passing a parameter to an EventSource
method. (You can even use classic {0}
numeric format specifiers, and still get structured events with numbered, rather than named, properties!)
Because the APIs are compatible, moving existing apps from one style of ILogger
to another is less friction than porting everything to EventSource
s. There are several ways to approach it, if you decide its an option I'll keep an eye out for any follow-up questions.