@@ -2,7 +2,7 @@ | |||||
<PropertyGroup> | <PropertyGroup> | ||||
<VersionMajor>2</VersionMajor> | <VersionMajor>2</VersionMajor> | ||||
<VersionMinor>2</VersionMinor> | <VersionMinor>2</VersionMinor> | ||||
<VersionPatch>2</VersionPatch> | |||||
<VersionPatch>3</VersionPatch> | |||||
<VersionQuality></VersionQuality> | <VersionQuality></VersionQuality> | ||||
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix> | <VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
@@ -1,6 +1,5 @@ | |||||
using Microsoft.AspNetCore; | using Microsoft.AspNetCore; | ||||
using Microsoft.AspNetCore.Hosting; | using Microsoft.AspNetCore.Hosting; | ||||
using NLog.Web; | |||||
namespace Sample.Kafka.MySql | namespace Sample.Kafka.MySql | ||||
{ | { | ||||
@@ -14,12 +13,7 @@ namespace Sample.Kafka.MySql | |||||
public static IWebHost BuildWebHost(string[] args) => | public static IWebHost BuildWebHost(string[] args) => | ||||
WebHost.CreateDefaultBuilder(args) | WebHost.CreateDefaultBuilder(args) | ||||
.UseStartup<Startup>() | |||||
.ConfigureLogging((hostingContext, builder) => | |||||
{ | |||||
hostingContext.HostingEnvironment.ConfigureNLog("nlog.config"); | |||||
}) | |||||
.UseNLog() | |||||
.UseStartup<Startup>() | |||||
.Build(); | .Build(); | ||||
} | } | ||||
} | } |
@@ -1,30 +1,20 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk.Web"> | <Project Sdk="Microsoft.NET.Sdk.Web"> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<TargetFramework>netcoreapp2.0</TargetFramework> | |||||
<TargetFramework>netcoreapp2.1</TargetFramework> | |||||
<AssemblyName>Sample.Kafka.MySql</AssemblyName> | <AssemblyName>Sample.Kafka.MySql</AssemblyName> | ||||
<WarningsAsErrors>NU1701</WarningsAsErrors> | <WarningsAsErrors>NU1701</WarningsAsErrors> | ||||
<NoWarn>NU1701</NoWarn> | <NoWarn>NU1701</NoWarn> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" /> | |||||
<PackageReference Include="MySqlConnector" Version="0.38.0" /> | |||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.5.2" /> | |||||
<PackageReference Include="zipkin4net" Version="1.2.0" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /> | |||||
</ItemGroup> | |||||
<PackageReference Include="Microsoft.AspNetCore.App" /> | |||||
<PackageReference Include="MySqlConnector" Version="0.40.4" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\..\src\DotNetCore.CAP.Kafka\DotNetCore.CAP.Kafka.csproj" /> | <ProjectReference Include="..\..\src\DotNetCore.CAP.Kafka\DotNetCore.CAP.Kafka.csproj" /> | ||||
<ProjectReference Include="..\..\src\DotNetCore.CAP.MySql\DotNetCore.CAP.MySql.csproj" /> | <ProjectReference Include="..\..\src\DotNetCore.CAP.MySql\DotNetCore.CAP.MySql.csproj" /> | ||||
<ProjectReference Include="..\..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" /> | <ProjectReference Include="..\..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" /> | ||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<Content Update="nlog.config"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
</Content> | |||||
</ItemGroup> | |||||
</ItemGroup> | |||||
</Project> | </Project> |
@@ -1,26 +0,0 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||||
autoReload="true" | |||||
internalLogLevel="Warn" | |||||
internalLogFile="logs/internal-nlog.txt"> | |||||
<variable name="myLogLayout" | |||||
value="---------------------------------------------------------------------------${newline}Date:${longdate} Level:${uppercase:${level}} User:${aspnet-user-identity}(${aspnet-request-ip}) Logger:${logger} URL:${aspnet-request-method} ${aspnet-request-url:IncludePort=true:IncludeQueryString=true} Action:${aspnet-mvc-action} ${newline}Message:${message} ${newline}${onexception:Exception:${exception:format=toString}}" /> | |||||
<extensions> | |||||
<add assembly="NLog.Web.AspNetCore" /> | |||||
</extensions> | |||||
<!-- define various log targets --> | |||||
<targets> | |||||
<!-- write logs to file --> | |||||
<target name="allfile" xsi:type="File" fileName="logs/cap-all-${shortdate}.log" | |||||
layout="${myLogLayout}" /> | |||||
</targets> | |||||
<rules> | |||||
<!--All logs, including from Microsoft--> | |||||
<logger name="*" minlevel="Debug" writeTo="allfile" /> | |||||
</rules> | |||||
</nlog> |
@@ -1,6 +1,5 @@ | |||||
using Microsoft.AspNetCore; | using Microsoft.AspNetCore; | ||||
using Microsoft.AspNetCore.Hosting; | using Microsoft.AspNetCore.Hosting; | ||||
using NLog.Web; | |||||
namespace Sample.RabbitMQ.MySql | namespace Sample.RabbitMQ.MySql | ||||
{ | { | ||||
@@ -13,12 +12,7 @@ namespace Sample.RabbitMQ.MySql | |||||
public static IWebHost BuildWebHost(string[] args) => | public static IWebHost BuildWebHost(string[] args) => | ||||
WebHost.CreateDefaultBuilder(args) | WebHost.CreateDefaultBuilder(args) | ||||
.UseStartup<Startup>() | |||||
.ConfigureLogging((hostingContext, builder) => | |||||
{ | |||||
hostingContext.HostingEnvironment.ConfigureNLog("nlog.config"); | |||||
}) | |||||
.UseNLog() | |||||
.UseStartup<Startup>() | |||||
.Build(); | .Build(); | ||||
} | } | ||||
} | } |
@@ -1,31 +1,17 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk.Web"> | <Project Sdk="Microsoft.NET.Sdk.Web"> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<TargetFramework>netcoreapp2.0</TargetFramework> | |||||
</PropertyGroup> | |||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | |||||
<NoWarn>1701;1702;1705;3277;</NoWarn> | |||||
<WarningsAsErrors>NU1605;MSB3277</WarningsAsErrors> | |||||
<TargetFramework>netcoreapp2.1</TargetFramework> | |||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" /> | |||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.0.1" /> | |||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.5.2" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /> | |||||
</ItemGroup> | |||||
<PackageReference Include="Microsoft.AspNetCore.App" /> | |||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.1.0-rc1-final" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\..\src\DotNetCore.CAP.MySql\DotNetCore.CAP.MySql.csproj" /> | <ProjectReference Include="..\..\src\DotNetCore.CAP.MySql\DotNetCore.CAP.MySql.csproj" /> | ||||
<ProjectReference Include="..\..\src\DotNetCore.CAP.RabbitMQ\DotNetCore.CAP.RabbitMQ.csproj" /> | <ProjectReference Include="..\..\src\DotNetCore.CAP.RabbitMQ\DotNetCore.CAP.RabbitMQ.csproj" /> | ||||
<ProjectReference Include="..\..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" /> | <ProjectReference Include="..\..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | |||||
<Content Update="nlog.config"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
</Content> | |||||
</ItemGroup> | |||||
</Project> | </Project> |
@@ -1,26 +0,0 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||||
autoReload="true" | |||||
internalLogLevel="Warn" | |||||
internalLogFile="logs/internal-nlog.txt"> | |||||
<variable name="myLogLayout" | |||||
value="---------------------------------------------------------------------------${newline}Date:${longdate} Level:${uppercase:${level}} User:${aspnet-user-identity}(${aspnet-request-ip}) Logger:${logger} URL:${aspnet-request-method} ${aspnet-request-url:IncludePort=true:IncludeQueryString=true} Action:${aspnet-mvc-action} ${newline}Message:${message} ${newline}${onexception:Exception:${exception:format=toString}}" /> | |||||
<extensions> | |||||
<add assembly="NLog.Web.AspNetCore" /> | |||||
</extensions> | |||||
<!-- define various log targets --> | |||||
<targets> | |||||
<!-- write logs to file --> | |||||
<target name="allfile" xsi:type="File" fileName="logs/cap-all-${shortdate}.log" | |||||
layout="${myLogLayout}" /> | |||||
</targets> | |||||
<rules> | |||||
<!--All logs, including from Microsoft--> | |||||
<logger name="*" minlevel="Debug" writeTo="allfile" /> | |||||
</rules> | |||||
</nlog> |