/// <summary> /// Adds XMPP logger and logger configuration to the Avalonia DI container /// </summary> /// <param name="locator"></param> /// <returns></returns> public static IServiceCollection AddXmppLogging(this IServiceCollection serviceCollection) { var loggerFactory = new LoggerFactory(); var xmlLoggerConfig = new XmlLoggerConfiguration() { LogLevel = LogLevel.Information, Enabled = false, }; loggerFactory.AddProvider(new XmlLoggerProvider(xmlLoggerConfig)); serviceCollection.AddSingleton <XmlLoggerConfiguration>(xmlLoggerConfig); serviceCollection.AddSingleton <ILogger>(loggerFactory.CreateLogger(nameof(MatrixClient))); return(serviceCollection); }
public XmlLogger(string name, XmlLoggerConfiguration config) { this.name = name; this.config = config; }
public XmlLoggerProvider(XmlLoggerConfiguration config) { Configuration = config; }