Skip to content

Conversation

nblumhardt
Copy link
Member

Fixes #98

See the included sample Program.cs files for usage.

{
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One slight annoyance here - any idea how to get the information about the hosting environment - Development, Production etc. - without resolving IHostingEnvironment from DI?

</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.0" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one's a bit unfortunate, as David points out. Still may not be much of a problem in practice. Could split UseSerilog() out to a separate package, if we want to...?

@merbla
Copy link
Contributor

merbla commented Aug 27, 2017

As per recent discussions lets get this in. We can always iterate before this ships.

@merbla merbla merged commit 5e359d9 into serilog:dev Aug 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants