Logging :: Implementations :: AggregateLogger - mkloubert/CLRToolbox GitHub Wiki
The AggregateLogger class puts other logger together and sends the log message that was logged via the AggregateLogger to the others, even if one of these loggers fails.
The execution is done in the same thread.
var allLoggers = new AggregateLogger();
// first logger is a Console based logger
allLoggers.Add(new ConsoleLogger());
// second logger is an own implementation called 'MyCustomLogger'
allLoggers.Add(new MyCustomLogger());
// log and send the log message to both added loggers
// ('ConsoleLogger' and 'MyCustomLogger')
allLoggers.Log("That should be logged in DEBUG mode only.",
LoggerFacadeCategories.Debug | LoggerFacadeCategories.Information);