Skip to content

Commit 4688ab3

Browse files
committed
Dependency updates, langversion, embed README
1 parent 08e9025 commit 4688ab3

File tree

8 files changed

+39
-462
lines changed

8 files changed

+39
-462
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)assets/Serilog.snk</AssemblyOriginatorKeyFile>
88
<Nullable>enable</Nullable>
99
<ImplicitUsings>enable</ImplicitUsings>
10+
<LangVersion>latest</LangVersion>
1011
</PropertyGroup>
1112
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
1213
<Reference Include="System" />

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Writes [Serilog](https://serilog.net) events to one or more text files.
77
Install the [Serilog.Sinks.File](https://www.nuget.org/packages/Serilog.Sinks.File/) package from NuGet:
88

99
```powershell
10-
Install-Package Serilog.Sinks.File
10+
dotnet add package Serilog.Sinks.File
1111
```
1212

1313
To configure the sink in C# code, call `WriteTo.File()` during logger configuration:
@@ -36,7 +36,7 @@ The limit can be changed or removed using the `fileSizeLimitBytes` parameter.
3636

3737
```csharp
3838
.WriteTo.File("log.txt", fileSizeLimitBytes: null)
39-
```
39+
```
4040

4141
For the same reason, only **the most recent 31 files** are retained by default (i.e. one long month). To change or remove this limit, pass the `retainedFileCountLimit` parameter.
4242

example/Sample/Program.cs

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,27 @@
11
using Serilog;
22
using Serilog.Debugging;
33

4-
namespace Sample;
4+
SelfLog.Enable(Console.Out);
55

6-
public class Program
7-
{
8-
public static void Main(string[] args)
9-
{
10-
SelfLog.Enable(Console.Out);
11-
12-
var sw = System.Diagnostics.Stopwatch.StartNew();
6+
var sw = System.Diagnostics.Stopwatch.StartNew();
137

14-
Log.Logger = new LoggerConfiguration()
15-
.WriteTo.File("log.txt")
16-
.CreateLogger();
8+
Log.Logger = new LoggerConfiguration()
9+
.WriteTo.File("log.txt")
10+
.CreateLogger();
1711

18-
for (var i = 0; i < 1000000; ++i)
19-
{
20-
Log.Information("Hello, file logger!");
21-
}
12+
for (var i = 0; i < 1000000; ++i)
13+
{
14+
Log.Information("Hello, file logger!");
15+
}
2216

23-
Log.CloseAndFlush();
17+
Log.CloseAndFlush();
2418

25-
sw.Stop();
19+
sw.Stop();
2620

27-
Console.WriteLine($"Elapsed: {sw.ElapsedMilliseconds} ms");
28-
Console.WriteLine($"Size: {new FileInfo("log.txt").Length}");
21+
Console.WriteLine($"Elapsed: {sw.ElapsedMilliseconds} ms");
22+
Console.WriteLine($"Size: {new FileInfo("log.txt").Length}");
2923

30-
Console.WriteLine("Press any key to delete the temporary log file...");
31-
Console.ReadKey(true);
24+
Console.WriteLine("Press any key to delete the temporary log file...");
25+
Console.ReadKey(true);
3226

33-
File.Delete("log.txt");
34-
}
35-
}
27+
File.Delete("log.txt");

example/Sample/Sample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net48;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net48;net8.0</TargetFrameworks>
55
<OutputType>Exe</OutputType>
66
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
77
</PropertyGroup>

src/Serilog.Sinks.File/Serilog.Sinks.File.csproj

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,45 @@
22

33
<PropertyGroup>
44
<Description>Write Serilog events to text files in plain or JSON format.</Description>
5-
<VersionPrefix>5.0.1</VersionPrefix>
5+
<VersionPrefix>6.0.0</VersionPrefix>
66
<Authors>Serilog Contributors</Authors>
7-
<TargetFrameworks>net45;netstandard1.3;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
7+
<!-- .NET Framework version targeting is frozen at these two TFMs. -->
8+
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT'">net471;net462</TargetFrameworks>
9+
<!-- Policy is to trim TFM-specific builds to `netstandard2.0`, `net6.0`,
10+
all active LTS versions, and optionally the latest RTM version, when releasing new
11+
major Serilog versions. -->
12+
<TargetFrameworks>$(TargetFrameworks);net8.0;net6.0;netstandard2.0</TargetFrameworks>
813
<GenerateDocumentationFile>true</GenerateDocumentationFile>
914
<PackageTags>serilog;file</PackageTags>
10-
<PackageIcon>images\icon.png</PackageIcon>
15+
<PackageIcon>serilog-sink-nuget.png</PackageIcon>
1116
<PackageIconUrl>https://serilog.net/images/serilog-sink-nuget.png</PackageIconUrl>
1217
<PackageProjectUrl>https://github.com/serilog/serilog-sinks-file</PackageProjectUrl>
1318
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
1419
<RepositoryUrl>https://github.com/serilog/serilog-sinks-file</RepositoryUrl>
1520
<RepositoryType>git</RepositoryType>
1621
<RootNamespace>Serilog</RootNamespace>
17-
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' == 'netstandard1.3' ">true</DisableImplicitFrameworkReferences>
18-
<EnableSourceLink Condition="'$(EnableSourceLink)' == ''">false</EnableSourceLink>
1922
<PublishRepositoryUrl>true</PublishRepositoryUrl>
20-
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
2123
<IncludeSymbols>True</IncludeSymbols>
2224
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
25+
<PackageReadmeFile>README.md</PackageReadmeFile>
2326
</PropertyGroup>
2427

2528
<ItemGroup>
26-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
27-
<PackageReference Include="Serilog" Version="2.10.0" />
29+
<PackageReference Include="Serilog" Version="4.0.0" />
2830
<PackageReference Include="Nullable" Version="1.3.1" PrivateAssets="All" />
2931
</ItemGroup>
3032

31-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
33+
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
3234
<DefineConstants>$(DefineConstants);ATOMIC_APPEND;HRESULTS</DefineConstants>
3335
</PropertyGroup>
3436

35-
<PropertyGroup Condition=" '$(TargetFramework)' != 'net45' ">
37+
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
3638
<DefineConstants>$(DefineConstants);OS_MUTEX</DefineConstants>
3739
</PropertyGroup>
3840

3941
<ItemGroup>
40-
<None Include="..\..\assets\serilog-sink-nuget.png" Pack="true" Visible="false" PackagePath="images\icon.png" />
42+
<None Include="..\..\assets\serilog-sink-nuget.png" Pack="true" Visible="false" PackagePath="/" />
43+
<None Include="..\..\README.md" Pack="true" Visible="false" PackagePath="/" />
4144
</ItemGroup>
4245

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

33
<PropertyGroup>
4-
<TargetFrameworks>net48;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net48;net8.0</TargetFrameworks>
55
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
66
</PropertyGroup>
77

@@ -10,12 +10,12 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
14-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageReference>
18-
<PackageReference Include="xunit" Version="2.4.2" />
18+
<PackageReference Include="xunit" Version="2.8.1" />
1919
</ItemGroup>
2020

2121
</Project>

0 commit comments

Comments
 (0)