Creating many Serilog Instances

44 views Asked by At

Root Question: Is there a major cost (or issue) in creating say 30 Serilog instances that are used for logging, then get disposed/properly cleaned up on lets say an hourly basis?

Serilog is meant to work utilizing an IOC, DI and ILoggers, however in our use case we have some legacy code utilizing AppDomains and reflection which we are unable to move away from.

Because of this, we want to log utilizing Serilog, but cannot reference the existing instances in the IOC, and cannot pass instances of it into our class. At the top level we will be creating ~30 of these domains at a time, constantly making new ones and then disposing of them. We can create new Serilog instances, but at what cost?

0

There are 0 answers