Skip to content

Commit a277cf3

Browse files
authored
Merge pull request #51 from mmarinchenko/dev
Align `<VersionPrefix>` & `<TargetFrameworks>` with `Serilog.Extensions.Logging` (+ bump up outdated package dependencies)
2 parents b8df615 + d6a96b4 commit a277cf3

File tree

10 files changed

+61
-34
lines changed

10 files changed

+61
-34
lines changed

Build.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ echo "build: Build started"
33
Push-Location $PSScriptRoot
44

55
if(Test-Path .\artifacts) {
6-
echo "build: Cleaning .\artifacts"
7-
Remove-Item .\artifacts -Force -Recurse
6+
echo "build: Cleaning .\artifacts"
7+
Remove-Item .\artifacts -Force -Recurse
88
}
99

1010
& dotnet restore --no-cache
@@ -16,24 +16,24 @@ $commitHash = $(git rev-parse --short HEAD)
1616
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1717

1818
echo "build: Package version suffix is $suffix"
19-
echo "build: Build version suffix is $buildSuffix"
19+
echo "build: Build version suffix is $buildSuffix"
2020

2121
foreach ($src in ls src/*) {
2222
Push-Location $src
2323

24-
echo "build: Packaging project in $src"
24+
echo "build: Packaging project in $src"
2525

2626
& dotnet build -c Release --version-suffix=$buildSuffix
2727
& dotnet pack -c Release --include-symbols -o ..\..\artifacts --version-suffix=$suffix --no-build
28-
if($LASTEXITCODE -ne 0) { exit 1 }
28+
if($LASTEXITCODE -ne 0) { exit 1 }
2929

3030
Pop-Location
3131
}
3232

3333
foreach ($test in ls test/*.Tests) {
3434
Push-Location $test
3535

36-
echo "build: Testing project in $test"
36+
echo "build: Testing project in $test"
3737

3838
& dotnet test -c Release
3939
if($LASTEXITCODE -ne 0) { exit 3 }

LICENSE

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Apache License
23
Version 2.0, January 2004
34
http://www.apache.org/licenses/
@@ -178,15 +179,15 @@
178179
APPENDIX: How to apply the Apache License to your work.
179180

180181
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "{}"
182+
boilerplate notice, with the fields enclosed by brackets "[]"
182183
replaced with your own identifying information. (Don't include
183184
the brackets!) The text should be enclosed in the appropriate
184185
comment syntax for the file format. We also recommend that a
185186
file or class name and description of purpose be included on the
186187
same "printed page" as the copyright notice for easier
187188
identification within third-party archives.
188189

189-
Copyright {yyyy} {name of copyright owner}
190+
Copyright [yyyy] [name of copyright owner]
190191

191192
Licensed under the Apache License, Version 2.0 (the "License");
192193
you may not use this file except in compliance with the License.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You can get started quickly with this package, and later migrate to the full Ser
1616
**1.** Add [the NuGet package](https://nuget.org/packages/serilog.extensions.logging.file) as a dependency of your project either with the package manager or directly to the CSPROJ file:
1717

1818
```xml
19-
<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0" />
19+
<PackageReference Include="Serilog.Extensions.Logging.File" Version="3.0.0" />
2020
```
2121

2222
**2.** In your `Program` class, configure logging on the web host builder, and call `AddFile()` on the provided `loggingBuilder`.

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2017
3+
image: Visual Studio 2022
44
configuration: Release
55
test: off
66
build_script:

assets/serilog-extension-nuget.png

21.9 KB
Loading

example/WebApplication/WebApplication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
16+
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" />
1717
</ItemGroup>
1818

1919
</Project>

serilog-extensions-logging-file.sln

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26430.14
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.32014.148
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0069BFD6-B0EE-4204-A85F-F75E31A77B3C}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{B0D573D8-1AE2-4C5C-817A-95815067452E}"
99
ProjectSection(SolutionItems) = preProject
10+
.gitattributes = .gitattributes
11+
.gitignore = .gitignore
1012
appveyor.yml = appveyor.yml
1113
Build.ps1 = Build.ps1
1214
LICENSE = LICENSE
@@ -50,4 +52,7 @@ Global
5052
{E640A22A-DF3C-40A2-AC72-DEB2F9B16241} = {0069BFD6-B0EE-4204-A85F-F75E31A77B3C}
5153
{64A3F2C5-D71E-44A6-8DC7-99474765B32E} = {D54DE844-AC36-4872-928F-5F573D41ACAE}
5254
EndGlobalSection
55+
GlobalSection(ExtensibilityGlobals) = postSolution
56+
SolutionGuid = {4A37A10E-F9A2-4578-9B58-EB7C07B64E66}
57+
EndGlobalSection
5358
EndGlobal

src/Serilog.Extensions.Logging.File/Microsoft/Extensions/Logging/FileLoggerExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Linq;
34
using Microsoft.Extensions.Configuration;
45
using Serilog;
56
using Serilog.Debugging;
67
using Serilog.Extensions.Logging.File;
7-
using System.Linq;
8+
using Serilog.Formatting;
89
using Serilog.Formatting.Compact;
910
using Serilog.Formatting.Display;
10-
using Serilog.Formatting;
1111

1212
namespace Microsoft.Extensions.Logging
1313
{
@@ -44,7 +44,7 @@ public static ILoggerFactory AddFile(this ILoggerFactory loggerFactory, IConfigu
4444
/// Adds a file logger initialized from the supplied configuration section.
4545
/// </summary>
4646
/// <param name="loggerFactory">The logger factory.</param>
47-
/// <param name="pathFormat">Filname to write. The filename may include {Date} to specify how the date portion of the
47+
/// <param name="pathFormat">Filname to write. The filename may include {Date} to specify how the date portion of the
4848
/// filename is calculated. May include environment variables.</param>
4949
/// <param name="minimumLevel">The level below which events will be suppressed (the default is <see cref="LogLevel.Information"/>).</param>
5050
/// <param name="levelOverrides">A dictionary mapping logger name prefixes to minimum logging levels.</param>
@@ -98,7 +98,7 @@ public static ILoggingBuilder AddFile(this ILoggingBuilder loggingBuilder, IConf
9898
/// Adds a file logger initialized from the supplied configuration section.
9999
/// </summary>
100100
/// <param name="loggingBuilder">The logging builder.</param>
101-
/// <param name="pathFormat">Filname to write. The filename may include {Date} to specify how the date portion of the
101+
/// <param name="pathFormat">Filname to write. The filename may include {Date} to specify how the date portion of the
102102
/// filename is calculated. May include environment variables.</param>
103103
/// <param name="minimumLevel">The level below which events will be suppressed (the default is <see cref="LogLevel.Information"/>).</param>
104104
/// <param name="levelOverrides">A dictionary mapping logger name prefixes to minimum logging levels.</param>
Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Add file logging to ASP.NET Core apps with one line of code.</Description>
5-
<VersionPrefix>2.0.0</VersionPrefix>
5+
<VersionPrefix>3.0.0</VersionPrefix>
66
<Authors>Serilog Contributors</Authors>
7-
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
7+
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010
<AssemblyName>Serilog.Extensions.Logging.File</AssemblyName>
@@ -13,9 +13,9 @@
1313
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
1414
<PackageId>Serilog.Extensions.Logging.File</PackageId>
1515
<PackageTags>asp.net;core;logging;file</PackageTags>
16-
<PackageIconUrl>http://serilog.net/images/serilog-extension-nuget.png</PackageIconUrl>
16+
<PackageIcon>serilog-extension-nuget.png</PackageIcon>
17+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1718
<PackageProjectUrl>https://github.com/serilog/serilog-extensions-logging-file</PackageProjectUrl>
18-
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
1919
<RepositoryUrl>https://github.com/serilog/serilog-extensions-logging-file</RepositoryUrl>
2020
<RepositoryType>git</RepositoryType>
2121
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
@@ -25,13 +25,36 @@
2525
</PropertyGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Serilog" Version="2.5.0" />
28+
<None Include="../../assets/serilog-extension-nuget.png" Pack="true" PackagePath="" />
29+
<None Include="../../LICENSE" Pack="true" PackagePath="" />
30+
</ItemGroup>
31+
32+
<ItemGroup>
33+
<PackageReference Include="Serilog" Version="2.10.0" />
34+
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
2935
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
30-
<PackageReference Include="Serilog.Formatting.Compact" Version="1.0.0" />
31-
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
32-
<PackageReference Include="Serilog.Sinks.Async" Version="1.1.0" />
33-
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" />
34-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.0.0" />
36+
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
37+
<PackageReference Include="Serilog.Formatting.Compact" Version="1.1.0" />
38+
</ItemGroup>
39+
40+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
41+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.2.0" />
42+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.2.4" />
43+
</ItemGroup>
44+
45+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
46+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.22" />
47+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.22" />
48+
</ItemGroup>
49+
50+
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
51+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
52+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="5.0.0" />
53+
</ItemGroup>
54+
55+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
56+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
57+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
3558
</ItemGroup>
3659

3760
</Project>
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
4+
<TargetFrameworks>net48;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
55
<AssemblyName>Serilog.Extensions.Logging.File.Tests</AssemblyName>
66
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
77
<SignAssembly>true</SignAssembly>
88
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
99
<PackageId>Serilog.Extensions.Logging.File.Tests</PackageId>
1010
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
11-
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
12-
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
1311
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1412
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1513
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
@@ -20,9 +18,9 @@
2018
</ItemGroup>
2119

2220
<ItemGroup>
23-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
24-
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
25-
<PackageReference Include="xunit" Version="2.2.0" />
21+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
22+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
23+
<PackageReference Include="xunit" Version="2.4.1" />
2624
</ItemGroup>
2725

2826
</Project>

0 commit comments

Comments
 (0)