Skip to content

Commit d8b1d92

Browse files
authored
Merge pull request #622 from serilog-mssql/dev
# 8.2.1 * Updated SqlClient to 5.2.3 (thanks to @cancakar35) * Fixes in .editorconfig (thanks to @cancakar35) * Convert AppConfigDemo to SDK style (thanks to @cancakar35) * Removed obsolete SourceLink package references * Small code style fixes
2 parents 4e9203a + dce8580 commit d8b1d92

File tree

9 files changed

+19
-80
lines changed

9 files changed

+19
-80
lines changed

.editorconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,4 @@ dotnet_naming_symbols.public_constant_static_fields.required_modifiers = const,
7676
dotnet_naming_style.pascal_case.capitalization = pascal_case
7777

7878
dotnet_sort_system_directives_first = true
79-
dotnet_style_require_accessibility_modifiers = always:error
80-
79+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 8.2.1
2+
* Updated SqlClient to 5.2.3 (thanks to @cancakar35)
3+
* Fixes in .editorconfig (thanks to @cancakar35)
4+
* Convert AppConfigDemo to SDK style (thanks to @cancakar35)
5+
* Removed obsolete SourceLink package references
6+
* Small code style fixes
7+
18
# 8.2.0
29
* Added `ConnectionConfiguration` sink option to customize SqlConnection before use (thanks to @nhart12)
310

Directory.Packages.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
77
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
88
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
9-
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.2" />
9+
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.3" />
1010
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
1111
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
1212
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
1313
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
14-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
1514
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
1615
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
1716
<PackageVersion Include="Dapper.StrongName" Version="2.1.35" />
@@ -22,4 +21,4 @@
2221
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" />
2322
<PackageVersion Include="Serilog.Settings.Configuration" Version="8.0.4" />
2423
</ItemGroup>
25-
</Project>
24+
</Project>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A Serilog sink that writes events to Microsoft SQL Server. This sink will write the log event data to a table and can optionally also store the properties inside an XML or JSON column so they can be queried. Important properties can also be written to their own separate columns.
44

55
**Package** - [Serilog.Sinks.MSSqlServer](http://nuget.org/packages/serilog.sinks.mssqlserver)
6-
| **Minimum Platforms** - .NET Framework 4.6.2, .NET 6.0, .NET Standard 2.0
6+
| **Minimum Platforms** - .NET Framework 4.6.2, .NET 8.0, .NET Standard 2.0
77

88
#### Topics
99

sample/AppConfigDemo/App.config

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
<configSections>
44
<section name="MSSqlServerSettingsSection" type="Serilog.Configuration.MSSqlServerConfigurationSection, Serilog.Sinks.MSSqlServer" />
55
</configSections>
6-
<startup>
7-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
8-
</startup>
96
<MSSqlServerSettingsSection>
107

118
<BatchPostingLimit Value="13" />
Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,9 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{6BFE1D21-1442-4375-AB69-14160B906A64}</ProjectGuid>
3+
<TargetFramework>net462</TargetFramework>
84
<OutputType>Exe</OutputType>
9-
<RootNamespace>AppConfigDemo</RootNamespace>
10-
<AssemblyName>AppConfigDemo</AssemblyName>
11-
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
12-
<FileAlignment>512</FileAlignment>
13-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14-
<Deterministic>true</Deterministic>
155
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<PlatformTarget>AnyCPU</PlatformTarget>
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<PlatformTarget>AnyCPU</PlatformTarget>
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
</PropertyGroup>
35-
<ItemGroup>
36-
<Reference Include="Microsoft.CSharp" />
37-
<Reference Include="Microsoft.Extensions.Configuration.Abstractions" />
38-
<Reference Include="Microsoft.Extensions.Primitives" />
39-
<Reference Include="mscorlib" />
40-
<Reference Include="Serilog" />
41-
<Reference Include="System" />
42-
<Reference Include="System.Buffers" />
43-
<Reference Include="System.Core" />
44-
<Reference Include="System.Data" />
45-
<Reference Include="System.Diagnostics.DiagnosticSource" />
46-
<Reference Include="System.Memory" />
47-
<Reference Include="System.Numerics" />
48-
<Reference Include="System.Numerics.Vectors" />
49-
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
50-
<Reference Include="System.Threading.Channels" />
51-
<Reference Include="System.Threading.Tasks.Extensions" />
52-
<Reference Include="System.ValueTuple" />
53-
<Reference Include="System.Xml" />
54-
</ItemGroup>
55-
<ItemGroup>
56-
<Compile Include="Program.cs" />
57-
</ItemGroup>
58-
<ItemGroup>
59-
<None Include="App.config" />
60-
</ItemGroup>
61-
<ItemGroup>
62-
<ProjectReference Include="..\..\src\Serilog.Sinks.MSSqlServer\Serilog.Sinks.MSSqlServer.csproj">
63-
<Project>{803cd13a-d54b-4cec-a55f-e22ae3d93b3c}</Project>
64-
<Name>Serilog.Sinks.MSSqlServer</Name>
65-
</ProjectReference>
66-
</ItemGroup>
676
<ItemGroup>
68-
<Folder Include="Properties\" />
7+
<ProjectReference Include="..\..\src\Serilog.Sinks.MSSqlServer\Serilog.Sinks.MSSqlServer.csproj" />
698
</ItemGroup>
70-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
719
</Project>

src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Description>A Serilog sink that writes events to Microsoft SQL Server and Azure SQL</Description>
5-
<VersionPrefix>8.2.0</VersionPrefix>
5+
<VersionPrefix>8.2.1</VersionPrefix>
66
<EnablePackageValidation>true</EnablePackageValidation>
77
<PackageValidationBaselineVersion>8.0.0</PackageValidationBaselineVersion>
88
<Authors>Michiel van Oudheusden;Christian Kadluba;Serilog Contributors</Authors>
@@ -33,7 +33,6 @@
3333
</PropertyGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
3736
<PackageReference Include="Microsoft.Data.SqlClient" />
3837
<PackageReference Include="Microsoft.Extensions.Configuration" />
3938
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />

src/Serilog.Sinks.MSSqlServer/Sinks/MSSqlServer/Output/XmlPropertyFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Serilog.Sinks.MSSqlServer.Output
99
{
1010
internal class XmlPropertyFormatter : IXmlPropertyFormatter
1111
{
12-
private static readonly Regex _invalidXMLChars = new Regex(
12+
private static readonly Regex _invalidXmlChars = new Regex(
1313
@"(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F\uFEFF\uFFFE\uFFFF]",
1414
RegexOptions.Compiled);
1515

@@ -61,7 +61,7 @@ private static string SimplifyScalar(object value)
6161
{
6262
if (value == null) return null;
6363

64-
return new XText(_invalidXMLChars.Replace(value.ToString(), m => "\\u" + ((ushort)m.Value[0]).ToString("x4", CultureInfo.InvariantCulture))).ToString();
64+
return new XText(_invalidXmlChars.Replace(value.ToString(), m => "\\u" + ((ushort)m.Value[0]).ToString("x4", CultureInfo.InvariantCulture))).ToString();
6565
}
6666

6767
private string SimplifyDictionary(ColumnOptions.PropertiesColumnOptions options, DictionaryValue dict)

src/Serilog.Sinks.MSSqlServer/Sinks/MSSqlServer/Platform/SqlCreateTableWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public string GetSql()
4848
{
4949
var common = (SqlColumn)column.ExtendedProperties["SqlColumn"];
5050

51-
sql.Append(GetColumnDDL(common));
51+
sql.Append(GetColumnDdl(common));
5252
if (dataTable.Columns.Count > i++) sql.Append(',');
5353
sql.AppendLine();
5454

@@ -84,7 +84,7 @@ public string GetSql()
8484
// Examples of possible output:
8585
// [Id] BIGINT IDENTITY(1,1) NOT NULL
8686
// [Message] VARCHAR(1024) NULL
87-
private static string GetColumnDDL(SqlColumn column)
87+
private static string GetColumnDdl(SqlColumn column)
8888
{
8989
var sb = new StringBuilder();
9090

0 commit comments

Comments
 (0)