0

We have a scenario whereby multiple pre-release versions of an application run in the same environment. The problem we're seeing is that, because our EventSource has the same name/guid, we cannot differentiate between logs.

Is it possible to configure the name/guid of the EventSource via config or otherwise at runtime?

We currently have a single-build deployment pipeline, so I don't think a build-time solution would work for us.

Richard Szalay
  • 83,269
  • 19
  • 178
  • 237

2 Answers2

2

That is not supported. Some teams do the following: add additional parameter to each event to pass a version/build identifier.

Another potential option would be to create a pre-build task to alter the source code (EventSource implementation) to assign different GUID each build. But in this case that would be hard to work with those logs.

1

We ended up filtering the observable by process id:

int currentProcessId = Process.GetCurrentProcess().Id;

new ObservableEventListener()
    .Where(ev => ev.ProcessId == currentProcessId)
    .LogToRollingFlatFile(...);

Obviously that won't work once we move out-of-proc, but it's fine for now.

Richard Szalay
  • 83,269
  • 19
  • 178
  • 237