Skip to content

Commit

Permalink
Prepare for next major release (#227)
Browse files Browse the repository at this point in the history
fixes #227
  • Loading branch information
ArieGato authored Dec 23, 2024
1 parent d54ba75 commit 416b020
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
analyze:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout source
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
label:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/labeler@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-22.04, windows-latest]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ The SSL support has been improved. Now all properties are used when creating the

Add support for `RabbitMQ.Client` version `7.0.0`. Note that this is a breaking change. The `RabbitMQ.Client` `7.0.0` is not compatible with the `RabbitMQ.Client` `6.x`.

### Added support for Serilog 4.1.0
### Added support for Serilog 4.2.0

Removed reference to `Serilog.Sinks.PeriodicBatching` and use `Serilog.Sinks.Batch` instead.

### Set message properties

Add support for setting `BasicProperties` before publishing a message. Properties can be set by creating a class implemnenting `ISendMessageEvents`.
Add support for setting `BasicProperties` before publishing a message. Properties can be set by creating a class implementing `ISendMessageEvents`.

```csharp
public void OnSetMessageProperties(LogEvent logEvent, IBasicProperties properties)
Expand Down Expand Up @@ -104,7 +104,7 @@ Add .net 9 to the target frameworks
### Breaking changes

- Upgrade RabbitMQ.Client to `7.0.0`.
- Upgrade Serilog to `4.1.0`.
- Upgrade Serilog to `4.2.0`.
- Renamed `Period` to `BufferingTimeLimit`.
- Renamed `RouteKey` to `RoutingKey`
- Removed `RoutingFunc`
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<ItemGroup Condition="$(MSBuildProjectName.Contains('.Tests'))">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ As of v3.0.0 we use [Semantic Versioning](https://semver.org) to express changes
|3.0.0|1.6.1|4.5.1|2.8.0|5.\*|
|6.0.0|2.0.0|4.7.2|2.8.0|6.\*|
|7.0.0|2.0.0|-|3.1.1|6.8.\*|
|8.0.0|2.0.0|-|4.1.0|7.0|
|8.0.0|2.0.0|-|4.2.0|7.0|

## Installation

Expand Down Expand Up @@ -325,6 +325,13 @@ loggerFactory
services.AddSingleton<ILoggerFactory>(loggerFactory);
```

## Customizing Message Properties and Routing Keys
To customize message properties, a class can be created that implements the ISendMessageEvents interface. This interface defines two methods that require implementation:

`OnSetMessageProperties`: This method is invoked before the message is sent to RabbitMQ and is used to configure the message's properties.

`OnGetRoutingKey`: This method determines the routing key for the message, ensuring proper delivery to the intended queue.

## Customize Message Properties and Routing Key

In order to set message properties, you can create a class which implements `ISendMessageEvents`.
Expand Down Expand Up @@ -357,7 +364,7 @@ public class CustomMessageEvents : ISendMessageEvents
return logEvent.Level switch
{
LogEventLevel.Error => "error",
_ => _defaultRoutingKey
_ => defaultRoutingKey
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/NetFromCodeSample/NetFromCodeSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Serilog.Sinks.RabbitMQ/Serilog.Sinks.RabbitMQ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="RabbitMQ.Client" Version="7.0.0" />
<PackageReference Include="Serilog" Version="4.1.0" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="All" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;net6.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net48;net8.0;net9.0</TargetFrameworks>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog.Settings.AppSettings" Version="3.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.RabbitMQ\Serilog.Sinks.RabbitMQ.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net9.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;net6.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net48;net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
<PackageReference Include="PublicApiGenerator" Version="11.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 416b020

Please sign in to comment.