mirror of
https://github.com/FastTunnel/FastTunnel.git
synced 2025-02-08 10:59:31 +08:00
日志库serilog替换log4net
This commit is contained in:
parent
e07584bcdd
commit
e795e46fd5
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
|
||||||
<Version>1.1.0</Version>
|
<Version>1.1.0</Version>
|
||||||
<PackageProjectUrl>https://github.com/FastTunnel/FastTunnel/tree/v2/FastTunnel.Api</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/FastTunnel/FastTunnel/tree/v2/FastTunnel.Api</PackageProjectUrl>
|
||||||
<RepositoryUrl>https://github.com/FastTunnel/FastTunnel/tree/v2/FastTunnel.Api</RepositoryUrl>
|
<RepositoryUrl>https://github.com/FastTunnel/FastTunnel/tree/v2/FastTunnel.Api</RepositoryUrl>
|
||||||
|
@ -9,8 +9,8 @@
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.17.0" />
|
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0" />
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.17.0" />
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0-preview.3.22175.4" />
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0-preview.3.22175.4" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="6.1.0" />
|
<PackageReference Include="Serilog.Extensions.Hosting" Version="5.0.0-dev-00095" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.2-dev-00890" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.File" Version="5.0.1-dev-00947" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -20,9 +22,6 @@
|
||||||
<None Update="install.bat">
|
<None Update="install.bat">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Update="log4net.config">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Update="uninstall.bat">
|
<None Update="uninstall.bat">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|
|
@ -10,6 +10,7 @@ using System;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using FastTunnel.Core;
|
using FastTunnel.Core;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
namespace FastTunnel.Client;
|
namespace FastTunnel.Client;
|
||||||
|
|
||||||
|
@ -29,21 +30,20 @@ class Program
|
||||||
|
|
||||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||||
Host.CreateDefaultBuilder(args)
|
Host.CreateDefaultBuilder(args)
|
||||||
|
.UseSerilog((hostBuilderContext, services, loggerConfiguration) =>
|
||||||
|
{
|
||||||
|
var enableFileLog = (bool)(hostBuilderContext.Configuration.GetSection("EnableFileLog")?.Get(typeof(bool)) ?? false);
|
||||||
|
loggerConfiguration.WriteTo.Console();
|
||||||
|
if (enableFileLog)
|
||||||
|
{
|
||||||
|
loggerConfiguration.WriteTo.File("Logs/log.txt", rollingInterval: RollingInterval.Day, retainedFileCountLimit: 7);
|
||||||
|
}
|
||||||
|
})
|
||||||
.UseWindowsService()
|
.UseWindowsService()
|
||||||
.ConfigureServices((hostContext, services) =>
|
.ConfigureServices((hostContext, services) =>
|
||||||
{
|
{
|
||||||
// -------------------FastTunnel START------------------
|
// -------------------FastTunnel START------------------
|
||||||
services.AddFastTunnelClient(hostContext.Configuration.GetSection("ClientSettings"));
|
services.AddFastTunnelClient(hostContext.Configuration.GetSection("ClientSettings"));
|
||||||
// -------------------FastTunnel EDN--------------------
|
// -------------------FastTunnel EDN--------------------
|
||||||
})
|
|
||||||
.ConfigureLogging((HostBuilderContext context, ILoggingBuilder logging) =>
|
|
||||||
{
|
|
||||||
var enableFileLog = (bool)(context.Configuration.GetSection("EnableFileLog")?.Get(typeof(bool)) ?? false);
|
|
||||||
if (enableFileLog)
|
|
||||||
{
|
|
||||||
logging.ClearProviders();
|
|
||||||
logging.SetMinimumLevel(LogLevel.Trace);
|
|
||||||
logging.AddLog4Net();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
// Trace Debug Information Warning Error
|
// Trace Debug Information Warning Error
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 是否启用文件日志输出
|
// 是否启用文件日志输出
|
||||||
"EnableFileLog": false,
|
"EnableFileLog": true,
|
||||||
"ClientSettings": {
|
"ClientSettings": {
|
||||||
"Server": {
|
"Server": {
|
||||||
// [必选] 服务端ip/域名(来自服务端配置文件的urls参数)
|
// [必选] 服务端ip/域名(来自服务端配置文件的urls参数)
|
||||||
|
@ -61,4 +61,4 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<log4net>
|
|
||||||
<!-- If you are looking here and want more output, first thing to do is change root/priority/@value to "INFO" or "ALL". -->
|
|
||||||
<root>
|
|
||||||
Value of priority may be ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF.
|
|
||||||
<priority value="ALL" />
|
|
||||||
<appender-ref ref="error-file" />
|
|
||||||
<appender-ref ref="debug-file" />
|
|
||||||
<appender-ref ref="info-console" />
|
|
||||||
</root>
|
|
||||||
|
|
||||||
<!-- Example of turning on the output from a component or namespace. -->
|
|
||||||
<logger name="Common">
|
|
||||||
<appender-ref ref="debugger"/>
|
|
||||||
<priority value="DEBUG" />
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<appender name="debugger" type="log4net.Appender.DebugAppender">
|
|
||||||
<!-- Sends log messages to Visual Studio if attached. -->
|
|
||||||
<immediateFlush value="true" />
|
|
||||||
<layout type="log4net.Layout.SimpleLayout" />
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="info-console" type="log4net.Appender.ConsoleAppender">
|
|
||||||
<layout type="log4net.Layout.PatternLayout">
|
|
||||||
<conversionPattern value="%date |%level%| %message%newline" />
|
|
||||||
</layout>
|
|
||||||
|
|
||||||
<filter type="log4net.Filter.LevelRangeFilter">
|
|
||||||
<param name="LevelMin" value="Info"/>
|
|
||||||
<param name="LevelMax" value="Fatal"/>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="debug-file" type="log4net.Appender.RollingFileAppender">
|
|
||||||
<param name="Encoding" value="utf-8" />
|
|
||||||
<file value="Logs/debug" />
|
|
||||||
<appendToFile value="true" />
|
|
||||||
<!-- Immediate flush on error log, to avoid data loss with sudden termination. -->
|
|
||||||
<immediateFlush value="true" />
|
|
||||||
<staticLogFileName value="false" />
|
|
||||||
<rollingStyle value="Date" />
|
|
||||||
<datepattern value="-yyyy.MM.dd'.log'" />
|
|
||||||
<!-- Prevents Orchard.exe from displaying locking debug messages. -->
|
|
||||||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
|
||||||
<layout type="log4net.Layout.PatternLayout">
|
|
||||||
<conversionPattern value="%date %level% [%thread] %logger - %P{Tenant} - %message%newline" />
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="error-file" type="log4net.Appender.RollingFileAppender">
|
|
||||||
<param name="Encoding" value="utf-8" />
|
|
||||||
<file value="Logs/error" />
|
|
||||||
<appendToFile value="true" />
|
|
||||||
<!-- Immediate flush on error log, to avoid data loss with sudden termination. -->
|
|
||||||
<immediateFlush value="true" />
|
|
||||||
<staticLogFileName value="false" />
|
|
||||||
<rollingStyle value="Date" />
|
|
||||||
<datepattern value="-yyyy.MM.dd'.log'" />
|
|
||||||
<!-- Prevents Orchard.exe from displaying locking debug messages. -->
|
|
||||||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
|
||||||
<filter type="log4net.Filter.LevelRangeFilter">
|
|
||||||
<!-- Only ERROR and FATAL log messages end up in this target, even if child loggers accept lower priority. -->
|
|
||||||
<param name="LevelMin" value="Error"/>
|
|
||||||
<param name="LevelMax" value="Fatal"/>
|
|
||||||
</filter>
|
|
||||||
<layout type="log4net.Layout.PatternLayout">
|
|
||||||
<conversionPattern value="%date [%thread] %logger - %P{Tenant} - %message [%P{Url}]%newline" />
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
</log4net>
|
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net6.0</TargetFrameworks>
|
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
|
||||||
<Version>2.1.0</Version>
|
<Version>2.1.0</Version>
|
||||||
<PackageProjectUrl>https://github.com/SpringHgui/FastTunnel</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/SpringHgui/FastTunnel</PackageProjectUrl>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
|
@ -20,8 +20,8 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0-preview.3.22175.4" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0-preview.3.22175.4" />
|
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="5.0.0" />
|
||||||
<PackageReference Include="Yarp.ReverseProxy" Version="1.1.0" />
|
<PackageReference Include="Yarp.ReverseProxy" Version="1.1.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -1,46 +1,45 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<DefineConstants>DEBUG</DefineConstants>
|
<DefineConstants>DEBUG</DefineConstants>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
|
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="logs\**" />
|
<Compile Remove="logs\**" />
|
||||||
<Content Remove="logs\**" />
|
<Content Remove="logs\**" />
|
||||||
<EmbeddedResource Remove="logs\**" />
|
<EmbeddedResource Remove="logs\**" />
|
||||||
<None Remove="logs\**" />
|
<None Remove="logs\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.4" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0-preview.3.22175.4" />
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0-preview.3.22175.4" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0-preview.3.22175.4" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0-preview.3.22175.4" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0-preview.3.22175.4" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0-preview.3.22175.4" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="6.1.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="6.0.0-dev-00265" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.15.1" />
|
</ItemGroup>
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="'$(Configuration)'=='Debug'">
|
<ItemGroup Condition="'$(Configuration)'=='Debug'">
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.3.1" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.3.1" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.3.1" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.3.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\FastTunnel.Api\FastTunnel.Api.csproj" />
|
<ProjectReference Include="..\FastTunnel.Api\FastTunnel.Api.csproj" />
|
||||||
<ProjectReference Include="..\FastTunnel.Core\FastTunnel.Core.csproj" />
|
<ProjectReference Include="..\FastTunnel.Core\FastTunnel.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Update="uninstall.bat">
|
<None Update="uninstall.bat">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Update="install.bat">
|
<None Update="install.bat">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
namespace FastTunnel.Server;
|
namespace FastTunnel.Server;
|
||||||
|
|
||||||
|
@ -20,6 +21,15 @@ public class Program
|
||||||
|
|
||||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||||
Host.CreateDefaultBuilder(args)
|
Host.CreateDefaultBuilder(args)
|
||||||
|
.UseSerilog((hostBuilderContext, services, loggerConfiguration) =>
|
||||||
|
{
|
||||||
|
var enableFileLog = (bool)(hostBuilderContext.Configuration.GetSection("EnableFileLog")?.Get(typeof(bool)) ?? false);
|
||||||
|
loggerConfiguration.WriteTo.Console();
|
||||||
|
if (enableFileLog)
|
||||||
|
{
|
||||||
|
loggerConfiguration.WriteTo.File("Logs/log.txt", rollingInterval: RollingInterval.Day, retainedFileCountLimit: 7);
|
||||||
|
}
|
||||||
|
})
|
||||||
.UseWindowsService()
|
.UseWindowsService()
|
||||||
.ConfigureWebHost(webHostBuilder =>
|
.ConfigureWebHost(webHostBuilder =>
|
||||||
{
|
{
|
||||||
|
@ -33,15 +43,5 @@ public class Program
|
||||||
.ConfigureWebHostDefaults(webBuilder =>
|
.ConfigureWebHostDefaults(webBuilder =>
|
||||||
{
|
{
|
||||||
webBuilder.UseStartup<Startup>();
|
webBuilder.UseStartup<Startup>();
|
||||||
})
|
|
||||||
.ConfigureLogging((HostBuilderContext context, ILoggingBuilder logging) =>
|
|
||||||
{
|
|
||||||
var enableFileLog = (bool)context.Configuration.GetSection("EnableFileLog").Get(typeof(bool));
|
|
||||||
if (enableFileLog)
|
|
||||||
{
|
|
||||||
logging.ClearProviders();
|
|
||||||
logging.SetMinimumLevel(LogLevel.Trace);
|
|
||||||
logging.AddLog4Net();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<log4net>
|
|
||||||
<!-- If you are looking here and want more output, first thing to do is change root/priority/@value to "INFO" or "ALL". -->
|
|
||||||
<root>
|
|
||||||
Value of priority may be ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF.
|
|
||||||
<priority value="ALL" />
|
|
||||||
<appender-ref ref="error-file" />
|
|
||||||
<appender-ref ref="debug-file" />
|
|
||||||
<appender-ref ref="info-console" />
|
|
||||||
</root>
|
|
||||||
|
|
||||||
<!-- Example of turning on the output from a component or namespace. -->
|
|
||||||
<logger name="Common">
|
|
||||||
<appender-ref ref="debugger"/>
|
|
||||||
<priority value="DEBUG" />
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<appender name="debugger" type="log4net.Appender.DebugAppender">
|
|
||||||
<!-- Sends log messages to Visual Studio if attached. -->
|
|
||||||
<immediateFlush value="true" />
|
|
||||||
<layout type="log4net.Layout.SimpleLayout" />
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="info-console" type="log4net.Appender.ConsoleAppender">
|
|
||||||
<layout type="log4net.Layout.PatternLayout">
|
|
||||||
<conversionPattern value="%date |%level%| %message%newline" />
|
|
||||||
</layout>
|
|
||||||
|
|
||||||
<filter type="log4net.Filter.LevelRangeFilter">
|
|
||||||
<param name="LevelMin" value="Info"/>
|
|
||||||
<param name="LevelMax" value="Fatal"/>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="debug-file" type="log4net.Appender.RollingFileAppender">
|
|
||||||
<param name="Encoding" value="utf-8" />
|
|
||||||
<file value="Logs/debug" />
|
|
||||||
<appendToFile value="true" />
|
|
||||||
<!-- Immediate flush on error log, to avoid data loss with sudden termination. -->
|
|
||||||
<immediateFlush value="true" />
|
|
||||||
<staticLogFileName value="false" />
|
|
||||||
<rollingStyle value="Date" />
|
|
||||||
<datepattern value="-yyyy.MM.dd'.log'" />
|
|
||||||
<!-- Prevents Orchard.exe from displaying locking debug messages. -->
|
|
||||||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
|
||||||
<layout type="log4net.Layout.PatternLayout">
|
|
||||||
<conversionPattern value="%date %level% [%thread] %logger - %P{Tenant} - %message%newline" />
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="error-file" type="log4net.Appender.RollingFileAppender">
|
|
||||||
<param name="Encoding" value="utf-8" />
|
|
||||||
<file value="Logs/error" />
|
|
||||||
<appendToFile value="true" />
|
|
||||||
<!-- Immediate flush on error log, to avoid data loss with sudden termination. -->
|
|
||||||
<immediateFlush value="true" />
|
|
||||||
<staticLogFileName value="false" />
|
|
||||||
<rollingStyle value="Date" />
|
|
||||||
<datepattern value="-yyyy.MM.dd'.log'" />
|
|
||||||
<!-- Prevents Orchard.exe from displaying locking debug messages. -->
|
|
||||||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
|
||||||
<filter type="log4net.Filter.LevelRangeFilter">
|
|
||||||
<!-- Only ERROR and FATAL log messages end up in this target, even if child loggers accept lower priority. -->
|
|
||||||
<param name="LevelMin" value="Error"/>
|
|
||||||
<param name="LevelMax" value="Fatal"/>
|
|
||||||
</filter>
|
|
||||||
<layout type="log4net.Layout.PatternLayout">
|
|
||||||
<conversionPattern value="%date [%thread] %logger - %P{Tenant} - %message [%P{Url}]%newline" />
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
</log4net>
|
|
Loading…
Reference in New Issue
Block a user