Skip to content

Commit

Permalink
修复ErrorModule中间件中logger因为formatter为空
Browse files Browse the repository at this point in the history
  • Loading branch information
xxred committed Feb 13, 2019
1 parent b3e6642 commit df7b1db
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 15 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
4 changes: 1 addition & 3 deletions NewLife.CubeNC/Areas/Admin/Views/_ViewImports.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@using NewLife.Cube
@*@using NewLife.Cube.Models*@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using NewLife
@using NewLife.Cube
@using NewLife.Reflection
Expand Down
12 changes: 1 addition & 11 deletions NewLife.CubeNC/NewLife.CubeNC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" />
<PackageReference Include="NewLife.XCode" Version="9.10.6965.42078" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -187,21 +188,10 @@
<ItemGroup>
<EmbeddedResource Include="wwwroot\favicon.ico" />
</ItemGroup>
<ItemGroup>
<Reference Include="NewLife.Core">
<HintPath>..\DLL20\NewLife.Core.dll</HintPath>
</Reference>
<Reference Include="XCode">
<HintPath>..\DLL20\XCode.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Update="Areas\Admin\Views\_ViewImports.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="H:\Cache\Nuget\packages\newlife.xcode.test\9.8.6777.32318\contentFiles\any\netstandard2.0\Build.tt">
<Generator>TextTemplatingFileGenerator</Generator>
</Content>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="md &quot;$(ProjectDir)..\..\Bin\netstandard2.0&quot;&#xD;&#xA;copy &quot;$(TargetDir)$(TargetName)&quot;.* &quot;$(ProjectDir)..\..\Bin\netstandard2.0\&quot; /y" />
Expand Down
2 changes: 1 addition & 1 deletion NewLife.CubeNC/WebMiddleware/ErrorModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async Task Invoke(HttpContext context, IRazorViewEngine viewEngine, ILogg
catch (Exception e)
{
XTrace.WriteException(e);
logger.Log(LogLevel.Error, 1, e, e, null);
logger.Log(LogLevel.Error, 1, e, e, (e1, e2) => e.ToString());

if (context.Response.HasStarted)
{
Expand Down

0 comments on commit df7b1db

Please sign in to comment.