1

Examples for SLAB tend to look like this:

MyCompanyEventSource.Log.ScalingRequestSubmitted(
    request.RoleName, 
    request.InstanceCount,
    context.RuleName,
    context.CurrentInstanceCount);

I don't like that I have to edit MyCompanyEventSource every time I add a new event type. I also don't like that the logger is only available staticly. I'd rather have something like this:

_logger.Log(new ScalingRequestSubmittedEvent(request, context));

I know I can just roll my own logging, but before I dismiss SLAB entirely, I'd like to know if I'm being unfair.

Nathan Cooper
  • 6,262
  • 4
  • 36
  • 75

1 Answers1

2

There is no way to do things like this

_logger.Log(new ScalingRequestSubmittedEvent(request, context));

And you have to change your logger any time you wish to add a new type of event, change information level or keyword.

Writing of your own wrapper for EventSource is the only way to achieve desired functionality.

cassandrad
  • 3,412
  • 26
  • 50