Skip to content

Commit 5030d18

Browse files
committed
Migration of MSSQL sink repo to new org (#389)
* Removed AppVeyor pipeline file. We use GH actions now. * Updated URL all references to MSSQL sink repo. * Updated build badge in README. * Bumped version patch number. * Renamed 'master' branch to 'main'.
1 parent 6fba8d6 commit 5030d18

File tree

6 files changed

+43
-70
lines changed

6 files changed

+43
-70
lines changed

.github/workflows/pr-validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: PR Validation
22

33
on:
44
pull_request:
5-
branches: [ dev, master ]
5+
branches: [ dev, main ]
66

77
# Allows you to run this workflow manually from the Actions tab
88
workflow_dispatch:
@@ -12,6 +12,6 @@ jobs:
1212
runs-on: windows-latest
1313
steps:
1414
- uses: actions/checkout@v2
15-
15+
1616
- name: Run build and tests
1717
run: ./Build.ps1

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Release
22

33
on:
44
push:
5-
branches: [ dev, master ]
5+
branches: [ dev, main ]
66

77
# Allows you to run this workflow manually from the Actions tab
88
workflow_dispatch:
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: windows-latest
1313
steps:
1414
- uses: actions/checkout@v2
15-
15+
1616
- name: Run build
1717
run: ./Build.ps1 -SkipTests $true
1818

@@ -24,7 +24,7 @@ jobs:
2424
echo "Found version $versionMatch"
2525
2626
- name: Create GitHub releease
27-
if: ${{ github.ref_name == 'master' }}
27+
if: ${{ github.ref_name == 'main' }}
2828
uses: "marvinpinto/action-automatic-releases@latest"
2929
with:
3030
repo_token: "${{ secrets.GITHUB_TOKEN }}"
@@ -33,7 +33,7 @@ jobs:
3333
files: |
3434
artifacts/*.nupkg
3535
artifacts/*.snupkg
36-
36+
3737
- name: Publish to nuget.org
3838
env:
3939
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

CHANGES.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* Implemented Enhancement #182: configurable property names for custom columns (thanks to @rocknet for the contribution).
3434
* Lots of refactoring and new unit tests.
3535

36-
# 5.3.0
36+
# 5.3.0
3737
Code quality release.
3838
* Added code analysis and editorconfig rules based on Microsoft standards.
3939
* Fixed code analysis errors where possible and added justified suppressions the few remainig.
@@ -63,22 +63,22 @@ Code quality release.
6363

6464
# 4.0.0
6565
* Serilog 2.0
66-
* [Documentation fix](https://github.com/serilog/serilog-sinks-mssqlserver/pull/32)
66+
* [Documentation fix](https://github.com/serilog-mssql/serilog-sinks-mssqlserver/pull/32)
6767

6868
# 2.0.33
69-
* Option added to exclude redundant properties from serialized JSON in column LogEvent. (https://github.com/serilog/serilog-sinks-mssqlserver/pull/27)
69+
* Option added to exclude redundant properties from serialized JSON in column LogEvent. (https://github.com/serilog-mssql/serilog-sinks-mssqlserver/pull/27)
7070

7171
# 2.0.32
72-
* Safe conversion of data types. Also included selflog for bulk operation errors. (https://github.com/serilog/serilog-sinks-mssqlserver/pull/4)
72+
* Safe conversion of data types. Also included selflog for bulk operation errors. (https://github.com/serilog-mssql/serilog-sinks-mssqlserver/pull/4)
7373

7474
# 2.0.31
75-
* Added the ability to configure additional columns via XML configuration (https://github.com/serilog/serilog-sinks-mssqlserver/pull/6)
75+
* Added the ability to configure additional columns via XML configuration (https://github.com/serilog-mssql/serilog-sinks-mssqlserver/pull/6)
7676

7777
# 2.0.30
78-
* You can optionally save the log event inside the database too. Also added ability to exclude the properties if they are saved already inside additional columns. (https://github.com/serilog/serilog-sinks-mssqlserver/pull/7)
78+
* You can optionally save the log event inside the database too. Also added ability to exclude the properties if they are saved already inside additional columns. (https://github.com/serilog-mssql/serilog-sinks-mssqlserver/pull/7)
7979

8080
# 2.0.28
81-
* Added explicit column mappings (https://github.com/serilog/serilog-sinks-mssqlserver/pull/10)
81+
* Added explicit column mappings (https://github.com/serilog-mssql/serilog-sinks-mssqlserver/pull/10)
8282

8383
# 2.0.27
8484
* Option added to automatically create a database table (by Kiran Varsani (https://github.com/varsanikp))
@@ -87,7 +87,7 @@ Code quality release.
8787
* Ability to add additional properties as columns in the database
8888

8989
# 2.0.1
90-
* Option to [write times in UTC](https://github.com/serilog/serilog-sinks-mssqlserver/pull/1)
90+
* Option to [write times in UTC](https://github.com/serilog-mssql/serilog-sinks-mssqlserver/pull/1)
9191

9292
# 1.5
9393
* Moved from serilog/serilog

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Serilog.Sinks.MSSqlServer [![Build status](https://ci.appveyor.com/api/projects/status/3btbux1hbgyugind/branch/master?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-mssqlserver/branch/master) [![NuGet](https://img.shields.io/nuget/v/Serilog.Sinks.MSSqlServer.svg)](https://nuget.org/packages/Serilog.Sinks.MSSqlServer)
1+
# Serilog.Sinks.MSSqlServer ![Build & Test](https://github.com/serilog-mssql/serilog-sinks-mssqlserver/actions/workflows/pr-validation.yml/badge.svg) [![NuGet](https://img.shields.io/nuget/v/Serilog.Sinks.MSSqlServer.svg)](https://nuget.org/packages/Serilog.Sinks.MSSqlServer)
22

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

@@ -147,7 +147,7 @@ var log = new LoggerConfiguration()
147147

148148
### Code + _System.Configuration_
149149

150-
Projects can load `MSSqlServerSinkOptions` and `ColumnOptions` objects from an XML configuration file such as `app.config` or `web.config`. The sink configuration method automatically checks `ConfigurationManager`, so there is no code to show, and no additional packages are required. See the [External Configuration Syntax](#external-configuration-syntax) topic for details.
150+
Projects can load `MSSqlServerSinkOptions` and `ColumnOptions` objects from an XML configuration file such as `app.config` or `web.config`. The sink configuration method automatically checks `ConfigurationManager`, so there is no code to show, and no additional packages are required. See the [External Configuration Syntax](#external-configuration-syntax) topic for details.
151151

152152
### External using _Serilog.Settings.Configuration_
153153

@@ -194,7 +194,7 @@ CREATE TABLE [Logs] (
194194
[Exception] nvarchar(max) NULL,
195195
[Properties] nvarchar(max) NULL
196196
197-
CONSTRAINT [PK_Logs] PRIMARY KEY CLUSTERED ([Id] ASC)
197+
CONSTRAINT [PK_Logs] PRIMARY KEY CLUSTERED ([Id] ASC)
198198
);
199199
```
200200

@@ -263,17 +263,17 @@ A flag specifiying if the log events table should be created if it does not exis
263263

264264
### BatchPostingLimit
265265

266-
Specifies a maximum number of log events that the non-audit sink writes per batch. The default is 50.
266+
Specifies a maximum number of log events that the non-audit sink writes per batch. The default is 50.
267267
This setting is not used by the audit sink as it writes each event immediately and not in a batched manner.
268268

269269
### BatchPeriod
270270

271-
Specifies the interval in which the non-audit sink writes a batch of log events to the database. It defaults to 5 seconds.
271+
Specifies the interval in which the non-audit sink writes a batch of log events to the database. It defaults to 5 seconds.
272272
This setting is not used by the audit sink as it writes each event immediately and not in a batched manner.
273273

274274
### EagerlyEmitFirstEvent
275275

276-
A Flag to eagerly write a batch to the database containing the first received event regardless of `BatchPostingLimit` or `BatchPeriod`. It defaults to `true`.
276+
A Flag to eagerly write a batch to the database containing the first received event regardless of `BatchPostingLimit` or `BatchPeriod`. It defaults to `true`.
277277
This setting is not used by the audit sink as it writes each event immediately and not in a batched manner.
278278

279279
### UseAzureManagedIdentity
@@ -537,21 +537,21 @@ In this example, when a log event contains any of the properties `UserName`, `Us
537537

538538
Unlike previous versions of the sink, Standard Column names are not reserved. If you remove the `Id` Standard Column from the `ColumnOptions.Store` list, you are free to create a new custom column called `Id` which the sink will treat like any other custom column fully under your control.
539539

540-
Note the use of the `SqlDbType` enumerations for specifying `DataType`. Unlike previous versions of the sink, .NET `System` data types and `DataColumn` objects are no longer used for custom column definition.
540+
Note the use of the `SqlDbType` enumerations for specifying `DataType`. Unlike previous versions of the sink, .NET `System` data types and `DataColumn` objects are no longer used for custom column definition.
541541

542542
### Excluding redundant data
543543

544-
By default, properties matching a custom column will still be included in the data saved to the XML `Properties` or JSON `LogEvent` column. This is consistent with the idea behind structured logging, and makes it easier to convert the log data to another document-data storage platform later, if desired.
544+
By default, properties matching a custom column will still be included in the data saved to the XML `Properties` or JSON `LogEvent` column. This is consistent with the idea behind structured logging, and makes it easier to convert the log data to another document-data storage platform later, if desired.
545545

546-
However, the properties being saved in their own columns can be excluded from these catch-all columns. Use the `columnOptions.Properties.ExcludeAdditionalProperties` parameter to exclude the redundant properties from the `Properties` XML column, or `columnOptions.LogEvent.ExcludeAdditionalProperties` if you're using the JSON `LogEvent` column.
546+
However, the properties being saved in their own columns can be excluded from these catch-all columns. Use the `columnOptions.Properties.ExcludeAdditionalProperties` parameter to exclude the redundant properties from the `Properties` XML column, or `columnOptions.LogEvent.ExcludeAdditionalProperties` if you're using the JSON `LogEvent` column.
547547

548548
Standard Columns are always excluded from the XML `Properties` column but Standard Columns are included in the JSON data for backwards-compatibility reasons. They can be excluded from the JSON `LogEvent` column with `columnOptions.LogEvent.ExcludeStandardColumns`.
549549

550550
## External Configuration Syntax
551551

552552
Projects targeting frameworks which are compatible with _System.Configuration_ automatically have support for XML-based configuration (either `app.config` or `web.config`) of a `MSSqlServerSinkOptions` parameters and a `ColumnOptions` table definition, and the _Serilog.Settings.AppSettings_ package adds XML-based configuration of other direct sink arguments (like `customFormatter` or `restrictedToMinimumLevel`).
553553

554-
Projects targeting frameworks which are compatible with _Microsoft.Extensions.Configuration_ can apply configuration-driven sink setup and `MSSqlServerSinkOptions` or `ColumnOptions` settings using the _Serilog.Settings.Configuration_ package or by supplying the appropriate arguments through code.
554+
Projects targeting frameworks which are compatible with _Microsoft.Extensions.Configuration_ can apply configuration-driven sink setup and `MSSqlServerSinkOptions` or `ColumnOptions` settings using the _Serilog.Settings.Configuration_ package or by supplying the appropriate arguments through code.
555555

556556
All properties of the `MSSqlServerSinkOptions` class are configurable and almost all of the `ColumnOptions` class except the `Properties.PropertyFilter` predicate expression, and all elements and lists shown are optional. In most cases configuration key names match the class property names, but there are some exceptions. For example, because `PrimaryKey` is a `SqlColumn` object reference when configured through code, external configuration uses a `primaryKeyColumnName` setting to identify the primary key by name.
557557

@@ -571,8 +571,8 @@ Keys and values are not case-sensitive. This is an example of configuring the si
571571
"Using": ["Serilog.Sinks.MSSqlServer"],
572572
"MinimumLevel": "Debug",
573573
"WriteTo": [
574-
{ "Name": "MSSqlServer",
575-
"Args": {
574+
{ "Name": "MSSqlServer",
575+
"Args": {
576576
"connectionString": "NamedConnectionString",
577577
"sinkOptionsSection": {
578578
"tableName": "Logs",
@@ -583,7 +583,7 @@ Keys and values are not case-sensitive. This is an example of configuring the si
583583
},
584584
"restrictedToMinimumLevel": "Warning",
585585
"columnOptionsSection": { . . . }
586-
}
586+
}
587587
}
588588
]
589589
}
@@ -612,15 +612,15 @@ As the name suggests, `columnOptionSection` is an entire configuration section i
612612
],
613613
"id": { "nonClusteredIndex": true },
614614
"level": { "columnName": "Severity", "storeAsEnum": false },
615-
"properties": {
615+
"properties": {
616616
"columnName": "Properties",
617-
"excludeAdditionalProperties": true,
617+
"excludeAdditionalProperties": true,
618618
"dictionaryElementName": "dict",
619619
"itemElementName": "item",
620-
"omitDictionaryContainerElement": false,
621-
"omitSequenceContainerElement": false,
622-
"omitStructureContainerElement": false,
623-
"omitElementIfEmpty": true,
620+
"omitDictionaryContainerElement": false,
621+
"omitSequenceContainerElement": false,
622+
"omitStructureContainerElement": false,
623+
"omitElementIfEmpty": true,
624624
"propertyElementName": "prop",
625625
"rootElementName": "root",
626626
"sequenceElementName": "seq",
@@ -667,9 +667,9 @@ Keys and values are case-sensitive. Case must match **_exactly_** as shown below
667667
</RemoveStandardColumns>
668668
<Columns>
669669
<add ColumnName="EventType" DataType="int"/>
670-
<add ColumnName="EnvironmentUserName"
671-
PropertyName="UserName"
672-
DataType="varchar"
670+
<add ColumnName="EnvironmentUserName"
671+
PropertyName="UserName"
672+
DataType="varchar"
673673
DataLength="50" />
674674
<add ColumnName="Release"
675675
DataType="varchar"
@@ -698,7 +698,7 @@ Keys and values are case-sensitive. Case must match **_exactly_** as shown below
698698
StructureElementName="struct"
699699
UsePropertyKeyAsElementName="false"/>
700700
<TimeStamp ConvertToUtc="true"/>
701-
</MSSqlServerSettingsSection>
701+
</MSSqlServerSettingsSection>
702702
```
703703

704704
### XML Sink (_Serilog.Settings.AppSettings_)
@@ -738,15 +738,15 @@ When you exit an application running in debug mode under Visual Studio, normal s
738738

739739
### Try a `dev` package
740740

741-
If you're reading about a feature that doesn't seem to work, check whether you're reading the docs for the `master` branch or the `dev` branch -- most Serilog repositories are configured to use the `dev` branch by default. If you see something interesting only described by the `dev` branch documentation, you'll have to reference a `dev`-versioned package. The repository automatically generates a new `dev` package whenever code-related changes are merged.
741+
If you're reading about a feature that doesn't seem to work, check whether you're reading the docs for the `main` branch or the `dev` branch -- most Serilog repositories are configured to use the `dev` branch by default. If you see something interesting only described by the `dev` branch documentation, you'll have to reference a `dev`-versioned package. The repository automatically generates a new `dev` package whenever code-related changes are merged.
742742

743743
### Are you really using this sink?
744744

745745
Please check your NuGet references and confirm you are specifically referencing _Serilog.Sinks.MSSqlServer_. In the early days of .NET Core, there was a popular Core-specific fork of this sink, but the documentation and NuGet project URLs pointed here. Today the package is marked deprecated, but we continue to see some confusion around this.
746746

747747
### .NET Framework apps must reference Microsoft.Data.SqlClient
748748

749-
If you are using the sink in a .NET Framework app, make sure to add a nuget package reference to Microsoft.Data.SqlClient in your app project. This is necessary due to a bug in SqlClient which can lead to exceptions about missing Microsoft assemblies. Details can be found in [issue 283](https://github.com/serilog/serilog-sinks-mssqlserver/issues/283#issuecomment-664397489) and [issue 208](https://github.com/serilog/serilog-sinks-mssqlserver/issues/208#issuecomment-664503566).
749+
If you are using the sink in a .NET Framework app, make sure to add a nuget package reference to Microsoft.Data.SqlClient in your app project. This is necessary due to a bug in SqlClient which can lead to exceptions about missing Microsoft assemblies. Details can be found in [issue 283](https://github.com/serilog-mssql/serilog-sinks-mssqlserver/issues/283#issuecomment-664397489) and [issue 208](https://github.com/serilog-mssql/serilog-sinks-mssqlserver/issues/208#issuecomment-664503566).
750750

751751
## Querying Property Data
752752

@@ -804,6 +804,6 @@ Feature | Notes
804804
:--- | :---
805805
`AdditionalDataColumns` | Use the `AdditionalColumns` collection instead. Configuring the sink no longer relies upon .NET `DataColumn` objects or .NET `System` types.
806806
`Id.BigInt` | Use `Id.DataType = SqlDb.BigInt` instead. (The `BigInt` property was only available in dev packages).
807-
`Binary` and `VarBinary` | Due to the way Serilog represents property data internally, it isn't possible for the sink to access property data as a byte array, so the sink can't write to these column types.
807+
`Binary` and `VarBinary` | Due to the way Serilog represents property data internally, it isn't possible for the sink to access property data as a byte array, so the sink can't write to these column types.
808808

809809
Most deprecated features are still available, but they are marked with the `[Obsolete]` attribute (which results in a compiler warning in your project) and will be removed in a future release. You should switch to the replacement implementations as soon as possible. Where possible, internally these are converted to the replacement implementation so that they only exist at the configuration level.

appveyor.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

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

Lines changed: 3 additions & 3 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</Description>
5-
<VersionPrefix>5.7.0</VersionPrefix>
5+
<VersionPrefix>5.7.1</VersionPrefix>
66
<Authors>Michiel van Oudheusden;Christian Kadluba;Serilog Contributors</Authors>
77
<TargetFrameworks>netstandard2.0;net452;net462;net472;netcoreapp3.1</TargetFrameworks>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -14,9 +14,9 @@
1414
<PackageId>Serilog.Sinks.MSSqlServer</PackageId>
1515
<PackageTags>serilog;sinks;mssqlserver</PackageTags>
1616
<PackageIcon>serilog-sink-nuget.png</PackageIcon>
17-
<PackageProjectUrl>https://github.com/serilog/serilog-sinks-mssqlserver</PackageProjectUrl>
17+
<PackageProjectUrl>https://github.com/serilog-mssql/serilog-sinks-mssqlserver</PackageProjectUrl>
1818
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
19-
<RepositoryUrl>https://github.com/serilog/serilog-sinks-mssqlserver</RepositoryUrl>
19+
<RepositoryUrl>https://github.com/serilog-mssql/serilog-sinks-mssqlserver</RepositoryUrl>
2020
<RepositoryType>git</RepositoryType>
2121
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2222
<EmbedUntrackedSources>true</EmbedUntrackedSources>

0 commit comments

Comments
 (0)