Log4Net输出自定义文件日志。
using log4net; using log4net.Appender; using log4net.Core; using log4net.Layout; using log4net.Repository.Hierarchy; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Text; namespace NetCoreLog { public static class CustomRollingFileLogger { private static readonly ConcurrentDictionary<string, ILog> loggerContainer = new ConcurrentDictionary<string, ILog>(); //默认配置 private const int MAX_SIZE_ROLL_BACKUPS = 20; private const string LAYOUT_PATTERN = "%n错误时间:%d %n错误级别:%-5p%n错误内容:%m%n"; private const string DATE_PATTERN = "yyyy-MM-dd"; private const