# Logging.EnterpriseLibrary **Repository Path**: deng.zz/Logging.EnterpriseLibrary ## Basic Information - **Project Name**: Logging.EnterpriseLibrary - **Description**: 使用Enterprise Library Logging Application Block为Microsoft.Extensions.Logging组件增加文件日志记录方式。 - **Primary Language**: C# - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2016-12-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #### 几点说明: 1. 使用了Enterprise Library Logging Application Block组件来记录日志到文件中,不支持.NET CORE; 2. 默认日志模板格式是“[时间戳],日志级别,日志内容”,可通过AppSetting自定义日志模板; 3. 默认日志位于站点目录或者exe所在目录下的Logging目录。 #### 调用如下: var loggerName = "Sample"; var factory = new LoggerFactory(); factory.AddConsole(); factory.AddFileLog(); var logger = factory.CreateLogger(loggerName); logger.LogWarning("sample warning"); logger.LogTrace("sample trace"); logger.LogInformation("sample information"); logger.LogError(0, new Exception("sample exception"), "sample error"); logger.LogDebug("sample debug"); logger.LogCritical("sample critical");