Skip to content

Commit ac1b398

Browse files
authored
Merge pull request #26 from serilog/dev
2.2.0 Release
2 parents 93d540b + 663a3a7 commit ac1b398

13 files changed

+136
-147
lines changed

Build.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@ if(Test-Path .\artifacts) {
1212
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
1313
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
1414
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
15+
$commitHash = $(git rev-parse --short HEAD)
16+
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1517

16-
echo "build: Version suffix is $suffix"
18+
echo "build: Package version suffix is $suffix"
19+
echo "build: Build version suffix is $buildSuffix"
1720

1821
foreach ($src in ls src/*) {
1922
Push-Location $src
2023

2124
echo "build: Packaging project in $src"
2225

23-
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
26+
& dotnet build -c Release --version-suffix=$buildSuffix
27+
28+
if($suffix) {
29+
& dotnet pack -c Release --include-source --no-build -o ..\..\artifacts --version-suffix=$suffix
30+
} else {
31+
& dotnet pack -c Release --include-source --no-build -o ..\..\artifacts
32+
}
2433
if($LASTEXITCODE -ne 0) { exit 1 }
2534

2635
Pop-Location

README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@ Valid values are those defined in the `LogEventLevel` enumeration: `Verbose`, `D
5050
Sinks are added with the `serilog:write-to` key. The setting name matches the configuration method name that you'd use in code, so the following are equivalent:
5151

5252
```csharp
53-
.WriteTo.LiterateConsole()
53+
.WriteTo.Console()
5454
```
5555

5656
In XML:
5757

5858
```xml
59-
<add key="serilog:write-to:LiterateConsole" />
59+
<add key="serilog:write-to:Console" />
6060
```
6161

6262
**NOTE: When using `serilog:*` keys need to be unique.**
6363

6464
Sink assemblies must be specified using the `serilog:using` syntax. For example, to configure
6565

6666
```csharp
67-
<add key="serilog:using:LiterateConsole" value="Serilog.Sinks.Literate" />
68-
<add key="serilog:write-to:LiterateConsole"/>
67+
<add key="serilog:using:Console" value="Serilog.Sinks.Console" />
68+
<add key="serilog:write-to:Console"/>
6969
```
7070

7171
If the sink accepts parameters, these are specified by appending the parameter name to the setting.
@@ -104,4 +104,27 @@ For example, to add the property `Release` with the value `"1.2-develop"` to all
104104
<add key="serilog:enrich:with-property:Release" value="1.2-develop" />
105105
```
106106

107-
See the [Serilog documentation](https://github.com/serilog/serilog/wiki/AppSettings) for further information.
107+
### Adding minimum level overrides
108+
109+
Since Serilog 2.1, [minimum level overrides](https://nblumhardt.com/2016/07/serilog-2-minimumlevel-override/) can be added to change the minimum level for some specific namespaces. This is done with the setting key `serilog:minimum-level:override:` followed by the *source context prefix*.
110+
111+
For instance, the following are equivalent :
112+
113+
```csharp
114+
Log.Logger = new LoggerConfiguration()
115+
.MinimumLevel.Information()
116+
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
117+
.MinimumLevel.Override("Microsoft.AspNetCore.Mvc", LogEventLevel.Error)
118+
```
119+
120+
and in XML
121+
122+
```xml
123+
<add key="serilog:minimum-level" value="Information" />
124+
<add key="serilog:minimum-level:override:Microsoft" value="Warning" />
125+
<add key="serilog:minimum-level:override:Microsoft.AspNetCore.Mvc" value="Error" />
126+
```
127+
128+
### Filtering
129+
130+
Filters can be specified using the _Serilog.Filters.Expressions_ package; see the [README](https://github.com/serilog/serilog-filters-expressions) there for more information.

appveyor.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2015
3+
environment:
4+
os: Visual Studio 2017
45
configuration: Release
5-
install:
6-
- ps: mkdir -Force ".\build\" | Out-Null
7-
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
8-
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetcli"
9-
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath -Version 1.0.0-preview2-003121'
10-
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
116
build_script:
127
- ps: ./Build.ps1
138
test: off

global.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

serilog-settings-appsettings.sln

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27130.2036
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440B-4129-9F7A-09B42D00397E}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}"
99
ProjectSection(SolutionItems) = preProject
1010
Build.ps1 = Build.ps1
11-
global.json = global.json
1211
README.md = README.md
1312
assets\Serilog.snk = assets\Serilog.snk
1413
EndProjectSection
1514
EndProject
1615
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7B927378-9F16-4F6F-B3F6-156395136646}"
1716
EndProject
18-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Settings.AppSettings", "src\Serilog.Settings.AppSettings\Serilog.Settings.AppSettings.xproj", "{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}"
17+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Settings.AppSettings", "src\Serilog.Settings.AppSettings\Serilog.Settings.AppSettings.csproj", "{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}"
1918
EndProject
20-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Settings.AppSettings.Tests", "test\Serilog.Settings.AppSettings.Tests\Serilog.Settings.AppSettings.Tests.xproj", "{3C2D8E01-5580-426A-BDD9-EC59CD98E618}"
19+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Settings.AppSettings.Tests", "test\Serilog.Settings.AppSettings.Tests\Serilog.Settings.AppSettings.Tests.csproj", "{1A0E25F6-B619-440D-BF49-CCBD98666A7C}"
2120
EndProject
2221
Global
2322
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -29,16 +28,19 @@ Global
2928
{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
3029
{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
3130
{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}.Release|Any CPU.Build.0 = Release|Any CPU
32-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Debug|Any CPU.Build.0 = Debug|Any CPU
34-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.ActiveCfg = Release|Any CPU
35-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
33+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
34+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C}.Release|Any CPU.Build.0 = Release|Any CPU
3635
EndGlobalSection
3736
GlobalSection(SolutionProperties) = preSolution
3837
HideSolutionNode = FALSE
3938
EndGlobalSection
4039
GlobalSection(NestedProjects) = preSolution
4140
{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4} = {037440DE-440B-4129-9F7A-09B42D00397E}
42-
{3C2D8E01-5580-426A-BDD9-EC59CD98E618} = {7B927378-9F16-4F6F-B3F6-156395136646}
41+
{1A0E25F6-B619-440D-BF49-CCBD98666A7C} = {7B927378-9F16-4F6F-B3F6-156395136646}
42+
EndGlobalSection
43+
GlobalSection(ExtensibilityGlobals) = postSolution
44+
SolutionGuid = {5FEAB963-FB05-4C61-9B3F-DCF1BE9BB28C}
4345
EndGlobalSection
4446
EndGlobal
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<Description>XML configuration (System.Configuration &lt;appSettings&gt;) support for Serilog.</Description>
5+
<VersionPrefix>2.2.0</VersionPrefix>
6+
<Authors>Serilog Contributors</Authors>
7+
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
8+
<AssemblyName>Serilog.Settings.AppSettings</AssemblyName>
9+
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
10+
<SignAssembly>true</SignAssembly>
11+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
12+
<PackageId>Serilog.Settings.AppSettings</PackageId>
13+
<PackageTags>serilog;xml</PackageTags>
14+
<PackageIconUrl>https://serilog.net/images/serilog-configuration-nuget.png</PackageIconUrl>
15+
<PackageProjectUrl>https://github.com/serilog/serilog-settings-appsettings</PackageProjectUrl>
16+
<PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
17+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
18+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
19+
<DelaySign>false</DelaySign>
20+
</PropertyGroup>
21+
22+
<ItemGroup>
23+
<PackageReference Include="Serilog" Version="2.6.0" />
24+
</ItemGroup>
25+
26+
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
27+
<Reference Include="System.Configuration" />
28+
<Reference Include="System" />
29+
<Reference Include="Microsoft.CSharp" />
30+
<Reference Include="System.Configuration" />
31+
</ItemGroup>
32+
33+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
34+
<PackageReference Include="System.Configuration.ConfigurationManager">
35+
<Version>4.4.1</Version>
36+
</PackageReference>
37+
</ItemGroup>
38+
39+
40+
</Project>

src/Serilog.Settings.AppSettings/Serilog.Settings.AppSettings.xproj

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/Serilog.Settings.AppSettings/project.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

test/Serilog.Settings.AppSettings.Tests/Properties/launchSettings.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net45;netcoreapp2.0</TargetFrameworks>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
14+
<PackageReference Include="xunit" Version="2.3.1" />
15+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
16+
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
17+
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
18+
<PackageReference Include="Serilog.Sinks.TextWriter" Version="2.0.0" />
19+
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.1.0" />
20+
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="2.0.0" />
21+
<PackageReference Include="Serilog.Sinks.Observable" Version="2.0.0-*" />
22+
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.0.0-*" />
23+
<PackageReference Include="Serilog.Enrichers.Process" Version="2.0.0-*" />
24+
<PackageReference Include="Serilog.Enrichers.Thread" Version="2.0.0" />
25+
</ItemGroup>
26+
27+
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
28+
<Reference Include="System.Configuration" />
29+
<Reference Include="System" />
30+
<Reference Include="Microsoft.CSharp" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<ProjectReference Include="..\..\src\Serilog.Settings.AppSettings\Serilog.Settings.AppSettings.csproj" />
35+
</ItemGroup>
36+
37+
<ItemGroup>
38+
<None Update="tests.config">
39+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
40+
</None>
41+
</ItemGroup>
42+
</Project>

test/Serilog.Settings.AppSettings.Tests/Serilog.Settings.AppSettings.Tests.xproj

Lines changed: 0 additions & 28 deletions
This file was deleted.

test/Serilog.Settings.AppSettings.Tests/Settings/AppSettingsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.IO;
3-
using Xunit;
43
using Serilog.Events;
54
using Serilog.Tests.Support;
65
using Serilog.Context;
6+
using Xunit;
77

88
namespace Serilog.Tests.AppSettings.Tests
99
{

test/Serilog.Settings.AppSettings.Tests/project.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)