Serilog sub-logging to sinks defined in runtime

32 Views Asked by At

I would like to use Serilog for logging application (WPF, Prism 8) specifics (exceptions and other execution related valuable info). In addition the application works with files in a folder decided in runtime (e.g. by instructing from operator) and "project" folder/file related info shall be logged to another logfile in this folder.

The application may work with multiple such folders during one application "session", but only one is active at time of actual logging.

Thus the application shall log to an application logfile and possibly several "project" logfiles.

Is this possible with Serilog? I am thinking about using sub-loggers (https://nblumhardt.com/2016/07/serilog-2-write-to-logger/), but I have no clue on how to add filters and filenames dynamically (during runtime) to the LoggerConfiguration.

Anyone have some info on this?

0

There are 0 best solutions below