Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d520ee8
Bumped patch version after release
ckadluba Sep 20, 2024
d1c4f21
Merge pull request #572 from serilog-mssql/ckadluba-post-release-7.0.…
ckadluba Sep 20, 2024
da08125
Fixed issue #540 in README.md
ckadluba Sep 26, 2024
5385cef
Editorconfig cleanup
ckadluba Sep 26, 2024
c1f7d85
Merge pull request #576 from ckadluba/540-level-column-length-autocreate
ckadluba Sep 26, 2024
17b9e1c
Fixed issue #541 in README.md
ckadluba Sep 26, 2024
614dbc9
Merge pull request #577 from ckadluba/541-timestamp-default-nullable
ckadluba Sep 26, 2024
579b06b
Added Benchmark.NET Performance Tests
ckadluba Sep 30, 2024
2b8b037
Merge pull request #578 from ckadluba/benchmark-tests
ckadluba Sep 30, 2024
af6459e
Create perf test results artifact
ckadluba Oct 1, 2024
a3ff1bb
Merge pull request #579 from ckadluba/benchmark-tests
ckadluba Oct 1, 2024
5f108a1
Remove runtime identifiers, fixes #580
david-brink-talogy Oct 2, 2024
5787666
Merge pull request #581 from david-brink-talogy/fix_remove_runtime_id…
ckadluba Oct 3, 2024
f779746
Minor cleanup in release.yml
ckadluba Oct 3, 2024
25f4573
Enhanced performance tests
ckadluba Oct 3, 2024
af9de4a
Use GitHub secret to filter in perftests.yml
ckadluba Oct 3, 2024
610288e
Merge pull request #582 from ckadluba/benchmark-tests
ckadluba Oct 3, 2024
48bc267
Build perf tests project during PR validation
ckadluba Oct 3, 2024
c8d98bd
Merge pull request #583 from ckadluba/benchmark-tests
ckadluba Oct 3, 2024
e07ce8e
Fixed namespace of unit test
ckadluba Oct 7, 2024
4506de7
Added SqlInsertStatementWriter benchmark
ckadluba Oct 7, 2024
89a53f7
Improved SqlBulkBatchWriter benchmark
ckadluba Oct 7, 2024
91fa58a
Merge pull request #585 from ckadluba/benchmarks-added
ckadluba Oct 7, 2024
c097a65
Updated CHANGES.md
ckadluba Oct 18, 2024
0259e0b
Merge pull request #588 from ckadluba/update-changes
ckadluba Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ trim_trailing_whitespace = true
[*.{csproj,json,config,yml}]
indent_size = 2

[*.sh]
end_of_line = lf

[*.{cmd,bat}]
end_of_line = crlf

Expand Down Expand Up @@ -43,7 +40,6 @@ csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/perftests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Performance Tests

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build-and-perftest:
runs-on: windows-latest # Build on Windows to ensure .NET Framework targets
steps:
- uses: actions/checkout@v4

- name: Run build
run: ./Build.ps1 -SkipTests
shell: pwsh

- name: Run performance tests
run: ./RunPerfTests.ps1 -Filter ${{ secrets.PERF_TESTS_FILTER }}
shell: pwsh

- name: Upload perf test results artifact
uses: actions/upload-artifact@v4
with:
name: perftestresults
path: artifacts\perftests
26 changes: 15 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
build-and-release:
build-perftest-and-release:
runs-on: windows-latest # Build on Windows to ensure .NET Framework targets
steps:
- uses: actions/checkout@v4
Expand All @@ -35,6 +35,10 @@ jobs:
run: ./Build.ps1 -SkipTests
shell: pwsh

- name: Run performance tests
run: ./RunPerfTests.ps1 -Filter "*QuickBenchmarks*"
shell: pwsh

- name: Get last commit message
id: last_commit
if: success() && github.ref == 'refs/heads/main'
Expand All @@ -47,34 +51,34 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Der Basisname der Dateien basierend auf der Versionsnummer
$baseFileName = "Serilog.Sinks.MSSqlServer.${{ env.VERSION }}"

# Suche die exakten Dateipfade für .nupkg und .snupkg
$nupkgFile = Get-ChildItem -Path "artifacts/$baseFileName*.nupkg" | Select-Object -First 1
$snupkgFile = Get-ChildItem -Path "artifacts/$baseFileName*.snupkg" | Select-Object -First 1
$perfReportSinkFile = Get-ChildItem -Path "artifacts/perftests/Serilog.Sinks.MSSqlServer.PerformanceTests.SinkQuickBenchmarks-report.csv" `
| Select-Object -First 1
$perfReportAuditSinkFile = Get-ChildItem -Path "artifacts/perftests/Serilog.Sinks.MSSqlServer.PerformanceTests.AuditSinkQuickBenchmarks-report.csv" `
| Select-Object -First 1

# Überprüfe, ob beide Dateien gefunden wurden
if (-not $nupkgFile) { Write-Error "nupkg file not found" ; exit 1 }
if (-not $snupkgFile) { Write-Error "snupkg file not found" ; exit 1 }
if (-not $perfReportSinkFile) { Write-Error "Benchmark report for sink file not found" ; exit 1 }
if (-not $perfReportAuditSinkFile) { Write-Error "Benchmark report for audit sink file not found" ; exit 1 }

# Ersetze Backslashes durch Forward Slashes für GitHub CLI-Kompatibilität
$nupkgFilePath = $nupkgFile.FullName -replace '\\', '/'
$snupkgFilePath = $snupkgFile.FullName -replace '\\', '/'
$perfReportSinkFilePath = $perfReportSinkFile.FullName -replace '\\', '/'
$perfReportAuditSinkFilePath = $perfReportAuditSinkFile.FullName -replace '\\', '/'

# Ausgabe der Dateipfade zu Debugging-Zwecken
Write-Host "Uploading files: $nupkgFilePath, $snupkgFilePath"
Write-Host "Uploading files: $nupkgFilePath, $snupkgFilePath $perfReportSinkFilePath $perfReportAuditSinkFilePath"

# Erstelle das Release mit den genauen Dateipfaden
gh release create v${{ env.VERSION }} `
--title "v${{ env.VERSION }}" `
--notes "$(Get-Content last_commit_message.txt)" `
$nupkgFilePath $snupkgFilePath
$nupkgFilePath $snupkgFilePath $perfReportSinkFilePath $perfReportAuditSinkFilePath
shell: pwsh

- name: Publish to nuget.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
nuget push artifacts\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_API_KEY }}
shell: pwsh
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ build/
bld/
[Bb]in/
[Oo]bj/
artifacts/
BenchmarkDotNet.Artifacts/

# Roslyn cache directories
*.ide/
Expand Down Expand Up @@ -125,7 +127,7 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
Expand Down
20 changes: 9 additions & 11 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@ foreach ($src in Get-ChildItem "$PSScriptRoot/src" -Directory) {
}

if ($SkipTests -eq $false) {
foreach ($test in Get-ChildItem "$PSScriptRoot/test" -Filter "*.PerformanceTests" -Directory) {
Push-Location $test.FullName

echo "build: Building performance test project in $($test.FullName)"

& dotnet build -c Release
if ($LASTEXITCODE -ne 0) { exit 2 }

Pop-Location
}

foreach ($test in Get-ChildItem "$PSScriptRoot/test" -Filter "*.Tests" -Directory) {
Push-Location $test.FullName

Expand All @@ -59,6 +48,15 @@ if ($SkipTests -eq $false) {

Pop-Location
}

# The performance benchmark tests should at least build without errors during PR validation
$perfTestProjectPath = "$PSScriptRoot/test/Serilog.Sinks.MSSqlServer.PerformanceTests"
Push-Location "$perfTestProjectPath"

echo "build: Building performance test project in $perfTestProjectPath"
& dotnet build -c Release

Pop-Location
}

Pop-Location
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 7.0.2
* Fixed issue #580: Removed deprecated transitive dependency on Microsoft.NETCore.Targets by removing runtime identifier (thanks to @david-brink-talogy)
* Fixed issues #540 and #541 in README
* Added performance tests including a GitHub actions workflow
* Minor cleanups and fixes

# 7.0.1
* Fixed issue #567: .NET Framework assemblies were not built properly
* Consolidated PR validation action workflows and updated some task versions
Expand Down
51 changes: 26 additions & 25 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
<PackageVersion Include="System.Formats.Asn1" Version="8.0.1" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.6" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
<PackageVersion Include="FluentAssertions" Version="6.7.0" />
<PackageVersion Include="Dapper.StrongName" Version="2.0.123" />
<PackageVersion Include="Moq" Version="4.18.2" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="Serilog" Version="4.0.0" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="5.0.1" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="3.4.0" />
</ItemGroup>
</Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
<PackageVersion Include="System.Formats.Asn1" Version="8.0.1" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.6" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
<PackageVersion Include="FluentAssertions" Version="6.7.0" />
<PackageVersion Include="Dapper.StrongName" Version="2.0.123" />
<PackageVersion Include="Moq" Version="4.18.2" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="Serilog" Version="4.0.0" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="5.0.1" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="3.4.0" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ CREATE TABLE [Logs] (
[Id] int IDENTITY(1,1) NOT NULL,
[Message] nvarchar(max) NULL,
[MessageTemplate] nvarchar(max) NULL,
[Level] nvarchar(128) NULL,
[TimeStamp] datetime NOT NULL,
[Level] nvarchar(max) NULL,
[TimeStamp] datetime NULL,
[Exception] nvarchar(max) NULL,
[Properties] nvarchar(max) NULL

Expand Down Expand Up @@ -468,7 +468,7 @@ If `DataLength` is set to a value different to -1 longer text will be truncated.

### Level

This column stores the event level (Error, Information, etc.). For backwards-compatibility reasons it defaults to a length of 128 characters, but 12 characters is recommended. Alternately, the `StoreAsEnum` property can be set to `true` which causes the underlying level enum integer value to be stored as a SQL `tinyint` column. The `DataType` property can only be set to `nvarchar` or `tinyint`. Setting the `DataType` to `tinyint` is identical to setting `StoreAsEnum` to `true`.
This column stores the event level (Error, Information, etc.). For backwards-compatibility reasons it defaults to a length of `nvarchar(max)` characters, but 12 characters is recommended. Alternately, the `StoreAsEnum` property can be set to `true` which causes the underlying level enum integer value to be stored as a SQL `tinyint` column. The `DataType` property can only be set to `nvarchar` or `tinyint`. Setting the `DataType` to `tinyint` is identical to setting `StoreAsEnum` to `true`.

### TimeStamp

Expand Down
30 changes: 30 additions & 0 deletions RunPerfTests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[CmdletBinding()]
param (
[Parameter(Mandatory = $false)]
[string]
$Filter = "*"
)

echo "perf: Performance tests started with Filter = $Filter"

Push-Location $PSScriptRoot

$artifactsPath = "$PSScriptRoot\artifacts\perftests"

if (Test-Path "$artifactsPath") {
echo "perf: Cleaning $artifactsPath"
Remove-Item "$artifactsPath" -Force -Recurse
}

New-Item -Path "$artifactsPath" -ItemType Directory

$perfTestProjectPath = "$PSScriptRoot/test/Serilog.Sinks.MSSqlServer.PerformanceTests"
Push-Location "$perfTestProjectPath"

echo "perf: Running performance test project in $perfTestProjectPath"
& dotnet run -c Release -- -f $Filter

cp ".\BenchmarkDotNet.Artifacts\results\*.*" "$artifactsPath\"
Pop-Location

Pop-Location
9 changes: 9 additions & 0 deletions serilog-sinks-mssqlserver.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.github\workflows\pr-validation.yml = .github\workflows\pr-validation.yml
README.md = README.md
.github\workflows\release.yml = .github\workflows\release.yml
RunPerfTests.ps1 = RunPerfTests.ps1
.github\workflows\perftests.yml = .github\workflows\perftests.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetStandardDemoLib", "sample\NetStandardDemo\NetStandardDemoLib\NetStandardDemoLib.csproj", "{8E69E31B-61C7-4175-B886-9C2078FCA477}"
Expand All @@ -43,6 +45,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NetStandardDemo", "NetStand
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppConfigDemo", "sample\AppConfigDemo\AppConfigDemo.csproj", "{6BFE1D21-1442-4375-AB69-14160B906A64}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.MSSqlServer.PerformanceTests", "test\Serilog.Sinks.MSSqlServer.PerformanceTests\Serilog.Sinks.MSSqlServer.PerformanceTests.csproj", "{106A6BAF-F8E4-408B-BB09-391330DA87F2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -81,6 +85,10 @@ Global
{6BFE1D21-1442-4375-AB69-14160B906A64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BFE1D21-1442-4375-AB69-14160B906A64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BFE1D21-1442-4375-AB69-14160B906A64}.Release|Any CPU.Build.0 = Release|Any CPU
{106A6BAF-F8E4-408B-BB09-391330DA87F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{106A6BAF-F8E4-408B-BB09-391330DA87F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{106A6BAF-F8E4-408B-BB09-391330DA87F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{106A6BAF-F8E4-408B-BB09-391330DA87F2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -95,6 +103,7 @@ Global
{F908C46D-E72E-41E4-975D-73733294F93F} = {7B2B80DE-427A-4FEC-A7CE-7AD81FED73DE}
{7B2B80DE-427A-4FEC-A7CE-7AD81FED73DE} = {AA346332-5BAF-47F1-B8FB-7600ED61265D}
{6BFE1D21-1442-4375-AB69-14160B906A64} = {AA346332-5BAF-47F1-B8FB-7600ED61265D}
{106A6BAF-F8E4-408B-BB09-391330DA87F2} = {F02D6513-6F45-452E-85A0-41A872A2C1F8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AAA6BF8D-7B53-4A5F-A79A-D1B306383B45}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>A Serilog sink that writes events to Microsoft SQL Server and Azure SQL</Description>
<VersionPrefix>7.0.1</VersionPrefix>
<VersionPrefix>7.0.2</VersionPrefix>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>7.0.0</PackageValidationBaselineVersion>
<Authors>Michiel van Oudheusden;Christian Kadluba;Serilog Contributors</Authors>
Expand All @@ -25,7 +25,6 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
Expand All @@ -40,7 +39,6 @@
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
<PackageReference Include="Serilog" />
<PackageReference Include="System.Formats.Asn1" />
<PackageReference Include="System.Private.Uri" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -76,6 +74,7 @@

<ItemGroup>
<InternalsVisibleTo Include="$(AssemblyName).Tests" PublicKey="0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b81894191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066b19485ec" />
<InternalsVisibleTo Include="$(AssemblyName).PerformanceTests" PublicKey="0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b81894191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066b19485ec" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" PublicKey="0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7" />
</ItemGroup>

Expand Down
Loading
Loading