VOOZH about

URL: https://www.nuget.org/packages/Elvia.Meldingsportalen.Logger/

⇱ NuGet Gallery | Elvia.Meldingsportalen.Logger 2.0.3




Elvia.Meldingsportalen.Logger 2.0.3

dotnet add package Elvia.Meldingsportalen.Logger --version 2.0.3
 
 
NuGet\Install-Package Elvia.Meldingsportalen.Logger -Version 2.0.3
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Elvia.Meldingsportalen.Logger" Version="2.0.3" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Elvia.Meldingsportalen.Logger" Version="2.0.3" />
 
Directory.Packages.props
<PackageReference Include="Elvia.Meldingsportalen.Logger" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Elvia.Meldingsportalen.Logger --version 2.0.3
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Elvia.Meldingsportalen.Logger, 2.0.3"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Elvia.Meldingsportalen.Logger@2.0.3
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Elvia.Meldingsportalen.Logger&version=2.0.3
 
Install as a Cake Addin
#tool nuget:?package=Elvia.Meldingsportalen.Logger&version=2.0.3
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Elvia.Meldingsportalen.Logger

Bibliotek for å logge til Meldingsportalen fra .NET-applikasjoner.

Kom i gang

1. Installer

dotnet add package Elvia.Meldingsportalen.Logger

2. Konfigurer

builder.Services.AddMeldingsportalen(platformConfig: null);

3. Dependency Injection

Erstatt system og flow med dine egne verdier.

internal class LoggerWorker(IMeldingsportalenLoggerFactory meldingsportalenLoggerFactory)
 
{
 private readonly IMeldingsportalenLogger _messageLogger =
 meldingsportalenLoggerFactory.GetOrCreate(system: "Meldingsportalen", flow: "DemoSimple");

}

4. Logg success

internal async Task YourFunction (CancellationToken stoppingToken)
{
 var invocation = new Invocation
 {
 ElapsedTime = TimeSpan.FromMilliseconds(123),
 Resource = "YourResorce",
 Payload = "Your Payload",
 TargetPayload = "Your Target Payload",
 Warnings = ["Warning 1", "Warning 2"],
 HttpStatusCode = 200,
 Client = "Your client",
 Tags = ["Tag1", "Tag2"],
 };

 await _messageLogger.LogSuccessAsync(invocation, stoppingToken);
}

4. Logg exception

internal async Task YourFunction (CancellationToken stoppingToken)
{
 var exception = new Exception("your exception");

 var failedInvocation = new Invocation
 {
 ElapsedTime = TimeSpan.FromMilliseconds(123),
 Resource = "YourResorce",
 Payload = "Your Payload",
 TargetPayload = "Your Target Payload",
 Warnings = ["Warning 1", "Warning 2"],
 HttpStatusCode = 500,
 Client = "Your client",
 Tags = ["Tag1", "Tag2"],
 };

 await _messageLogger.LogExceptionAsync(failedInvocation, exception, stoppingToken);
}

5. Sjekk for block og logg block

internal async Task YourFunction (CancellationToken stoppingToken)
{
 var yourBlockIdentifier = "key-du-vil-sjekke-paa";

 //sjekk om id er blokkert for <system,flow>
 var blockedStatus = await _messageLogger.GetBlockedStatusAsync(
 yourBlockIdentifier,
 stoppingToken
 );

 var invocation = new Invocation {... };

 //hvis den allerede er blokkert logger vi ny message på block
 if (blockedStatus == BlockedStatus.Blocked)
 {
 await _messageLogger.LogBlockedAsync(
 invocation: invocation,
 blockIdentifier: yourBlockIdentifier,
 stoppedStatus: Schema.Kafka.Invocations.StoppedStatus.Stopped,
 exception: _exception, //nullable
 cancellationToken: stoppingToken
 );
 }
 else
 {
 //kjør din vanlige prosessering her
 
 //dersom du har behov for å blokkere denne id'en for fremtidige meldinger
 await _messageLogger.LogBlockedAsync(
 invocation: invocation,
 blockIdentifier: yourBlockIdentifier,
 stoppedStatus: Schema.Kafka.Invocations.StoppedStatus.Stopped,
 exception: _exception, //nullable
 cancellationToken: stoppingToken
 );
 }
}

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Elvia.Meldingsportalen.Logger:

Package Downloads
Elvia.Edna.Events

Package Description

Elvia.PushReceiverCore

Core functionality for implementing a dotnet core based Push Receiver.

Elvia.Meldingsportalen.Common

Package Description

Elvia.Meldingsportalen.Rerun

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.3 6,928 3/19/2026
2.0.2 619 2/12/2026
2.0.1 397 1/26/2026
2.0.0 2,050 1/6/2026
1.1.27-beta 145 1/6/2026
1.1.26-beta 313 12/19/2025
1.1.25-beta 308 12/12/2025
1.1.24-beta 424 12/4/2025
1.1.23-beta 693 12/1/2025
1.1.22-beta 623 12/1/2025
1.1.21-beta 181 11/28/2025
1.1.20-beta 491 11/21/2025
1.1.19-beta 455 11/20/2025
1.1.18-beta 429 11/7/2025
1.1.17-beta 296 10/29/2025
1.1.16-beta 276 10/27/2025
1.1.15-beta 209 10/24/2025
1.1.14 1,223 10/9/2025
1.1.3 255 10/3/2025
1.1.2 221 10/3/2025
Loading failed