using System.Collections.Concurrent; using Microsoft.Extensions.Logging; namespace Mhf.Server.Web.Server.Kestrel { public class KestrelLoggerProvider: ILoggerProvider { private readonly ConcurrentDictionary _loggers = new ConcurrentDictionary(); public KestrelLoggerProvider() { } public ILogger CreateLogger(string categoryName) { return _loggers.GetOrAdd(categoryName, name => new KestrelLogger(name)); } public void Dispose() { _loggers.Clear(); } } }