Skip to content

Commit 7eb21bd

Browse files
authored
Merge pull request #210 from serilog/dev
5.0.0 Release
2 parents 272085f + e64e9a9 commit 7eb21bd

30 files changed

+583
-198
lines changed

Build.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if(Test-Path .\artifacts) {
1111

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];
14-
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
14+
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "main" -and $revision -ne "local"]
1515
$commitHash = $(git rev-parse --short HEAD)
1616
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1717

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,19 @@ By default, the file sink will flush each event written through it to disk. To i
193193

194194
The [Serilog.Sinks.Async](https://github.com/serilog/serilog-sinks-async) package can be used to wrap the file sink and perform all disk access on a background worker thread.
195195

196+
### Extensibility
197+
[`FileLifecycleHooks`](https://github.com/serilog/serilog-sinks-file/blob/master/src/Serilog.Sinks.File/Sinks/File/FileLifecycleHooks.cs) provide an extensibility point that allows hooking into different parts of the life cycle of a log file.
198+
199+
You can create a hook by extending from [`FileLifecycleHooks`](https://github.com/serilog/serilog-sinks-file/blob/master/src/Serilog.Sinks.File/Sinks/File/FileLifecycleHooks.cs) and overriding the `OnFileOpened` and/or `OnFileDeleting` methods.
200+
201+
- `OnFileOpened` provides access to the underlying stream that log events are written to, before Serilog begins writing events. You can use this to write your own data to the stream (for example, to write a header row), or to wrap the stream in another stream (for example, to add buffering, compression or encryption)
202+
203+
- `OnFileDeleting` provides a means to work with obsolete rolling log files, *before* they are deleted by Serilog's retention mechanism - for example, to archive log files to another location
204+
205+
Available hooks:
206+
207+
- [serilog-sinks-file-header](https://github.com/cocowalla/serilog-sinks-file-header): writes a header to the start of each log file
208+
- [serilog-sinks-file-gzip](https://github.com/cocowalla/serilog-sinks-file-gzip): compresses logs as they are written, using streaming GZIP compression
209+
- [serilog-sinks-file-archive](https://github.com/cocowalla/serilog-sinks-file-archive): archives obsolete rolling log files before they are deleted by Serilog's retention mechanism
210+
196211
_Copyright © 2016 Serilog Contributors - Provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html)._

appveyor.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
version: '{build}'
22
skip_tags: true
33
image:
4-
- Visual Studio 2017
4+
- Visual Studio 2019
55
- Ubuntu
6-
configuration: Release
76
build_script:
87
- ps: ./Build.ps1
98
for:
@@ -19,14 +18,14 @@ artifacts:
1918
deploy:
2019
- provider: NuGet
2120
api_key:
22-
secure: N59tiJECUYpip6tEn0xvdmDAEiP9SIzyLEFLpwiigm/8WhJvBNs13QxzT1/3/JW/
21+
secure: rbdBqxBpLt4MkB+mrDOYNDOd8aVZ1zMkysaVNAXNKnC41FYifzX3l9LM8DCrUWU5
2322
skip_symbols: true
2423
on:
25-
branch: /^(master|dev)$/
24+
branch: /^(main|dev)$/
2625
- provider: GitHub
2726
auth_token:
2827
secure: p4LpVhBKxGS5WqucHxFQ5c7C8cP74kbNB0Z8k9Oxx/PMaDQ1+ibmoexNqVU5ZlmX
2928
artifact: /Serilog.*\.nupkg/
3029
tag: v$(appveyor_build_version)
3130
on:
32-
branch: master
31+
branch: main

assets/serilog-sink-nuget.png

20.4 KB
Loading

example/Sample/Sample.csproj

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.0;net47</TargetFrameworks>
4+
<TargetFrameworks>net48;net5.0</TargetFrameworks>
5+
<LangVersion>8.0</LangVersion>
6+
<Nullable>enable</Nullable>
57
<AssemblyName>Sample</AssemblyName>
68
<OutputType>Exe</OutputType>
79
<PackageId>Sample</PackageId>
@@ -12,13 +14,5 @@
1214
<ProjectReference Include="..\..\src\Serilog.Sinks.File\Serilog.Sinks.File.csproj" />
1315
</ItemGroup>
1416

15-
<ItemGroup Condition=" '$(TargetFramework)' == 'net47' ">
16-
<Reference Include="System" />
17-
<Reference Include="Microsoft.CSharp" />
18-
</ItemGroup>
19-
20-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
21-
</ItemGroup>
22-
2317
</Project>
2418

serilog-sinks-file.sln

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5
1111
appveyor.yml = appveyor.yml
1212
Build.ps1 = Build.ps1
1313
build.sh = build.sh
14-
NuGet.Config = NuGet.Config
1514
README.md = README.md
1615
assets\Serilog.snk = assets\Serilog.snk
1716
EndProjectSection

serilog-sinks-file.sln.DotSettings

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Filenames/@EntryIndexedValue">True</s:Boolean>
3+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Serilog/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)