Confusion about how DiagnosticsService works with multiple applications (at once)

Nov 7, 2013 at 8:21 PM
Edited Nov 8, 2013 at 7:18 AM
DiagnosticsService ultimately is an SPPersistedObject with a unique GUID.

In ProvideAreas I load my areas and categories using the application 1 specific configuration manager. My only Area is Area1 and I have category Cat1_1 and Cat1_2.

Now imagine I want to run another "instance(?)" of the DiagnosticsService (application 2) with a different area of Area2 and its own, different categories.

How does that work given that the DiagnosticsService is de facto a singleton?
Does it mean my DiagnosticsService must have all the areas and all the categories of all my applications in order to work with any application? Or am I supposed to create my own custom derived type from DiagnosticsService for each application I develop? I hope not. I had the impression since I basically defered loading the areas and categories to the AreaCollection class (or more specific to the ConfigurationManager really) (which is a good idea in terms of separation of concerns) I didn't have to go that way.

I'm implementing my UlsLogger for SP 2013 but it hasn't changed that much I guess.
So I'd really be glad for any answers on the subject :)
Nov 8, 2013 at 8:42 AM
Nevermind. I re-designed it to work with different "service names" (not just string.empty).
That way every application can have its own DiagnosticsService with its very own Areas and Categories.