Closed dataspring closed 7 years ago
Thank you for the report.
Are you targeting .NET Core, or .NET 4.6?
If 4.6, can you please try adding the following to you .CSPROJ file?
<PackageReference Include="system.net.http" Version="4.3.1" />
(This may be the same issue as: https://github.com/serilog/serilog-sinks-seq/issues/57 if so.)
Best regards, Nick
I'm targeting .NET Core, i.e. .NETCoreApp 1.. I'm not sure I want to add that .NET 4.6 dll in this, as this app may be deployed in linux
Here's my csproj file
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PackageTargetFallback>portable-net45+win8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.1.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="1.4.0" />
<PackageReference Include="Serilog.Sinks.File" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.Literate" Version="2.1.0" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0-rc3" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CoreEncryption\CoreEncryption.csproj" />
</ItemGroup>
</Project>
Thanks for the follow-up.
<PackageReference Include="system.net.http" Version="4.3.1" />
is not a .NET Framework-only package (it's also available on .NET Core), but the reason I susggested it seems to only apply to .NET Framework projects. Since you're targeting the netcoreapp1.1
TFM this probably isn't relevant to your case.
C:\Bootstrap-api\Logs\
will require admin permissions to write to, unless you've overridden them manually for the folder. Is the app running under a user account with enough permissions to write files there?
Setting 'SelfLog.Enable(Console.Out)might shed some light on it (you may need to temporarily remove
LiterateConsole` so that you can see the output).
Closing, hope you found a solution to this - please let us know if you think there's still an issue here.
In asp.net core 1.1.1, using the serilog-extensions-logging, doesn't log and create log files under rollingfile sink but creates a file but doesn't log under file sink. Somehow the LitearteConsole is working. Strange though, any solution appreciated...my initialization code under Startup.cs is as follows: `
Code under Configure:
appsettings value for logLocation: "LogLocation": {"Path": "C:\Bootstrap-api\Logs\"} Serilog.Extensions.Logging ver 1.4.0