Skip to main content
edited title
Link
Disti
  • 1.6k
  • 2
  • 15
  • 41

User Use serilog as logging provider in blazor webassembly client app

deleted 11 characters in body
Source Link
Ruben Bartelink
  • 62.2k
  • 32
  • 196
  • 266

I'd like to use serilog in a blazor webassembly net 6 app, both on client and server sides. In this article I found out how to relay log entries to server so that they are written in log files.

In this approach however the Log static class is used to explicitly add log entries.

I'd like to add serilog as logging provider so that exceptions and automatically generated information are logged, too.

On server side I use

var builder = WebApplication.CreateBuilder(args); builder.Host .UseSerilog((ctx, lc) => { lc.ReadFrom.Configuration(ctx.Configuration); }); 

This way everything is passed to serilog.

UseSerilog is defined in Serilog.AspNetCore. Unfortunately, if I add Serilog.AspNetCore to my client project, the following error appears:

NETSDK1082 There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'

Is there a way to manually add serilog to logging providers, or in alternative, is there a way to add Serilog.AspNetCore package to client project?

Thank you

I'd like to use serilog in a blazor webassembly net 6 app, both on client and server sides. In this article I found out how to relay log entries to server so that they are written in log files.

In this approach however the Log static class is used to explicitly add log entries.

I'd like to add serilog as logging provider so that exceptions and automatically generated information are logged, too.

On server side I use

var builder = WebApplication.CreateBuilder(args); builder.Host .UseSerilog((ctx, lc) => { lc.ReadFrom.Configuration(ctx.Configuration); }); 

This way everything is passed to serilog.

UseSerilog is defined in Serilog.AspNetCore. Unfortunately, if I add Serilog.AspNetCore to my client project, the following error appears:

NETSDK1082 There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'

Is there a way to manually add serilog to logging providers, or in alternative, is there a way to add Serilog.AspNetCore package to client project?

Thank you

I'd like to use serilog in a blazor webassembly net 6 app, both on client and server sides. In this article I found out how to relay log entries to server so that they are written in log files.

In this approach however the Log static class is used to explicitly add log entries.

I'd like to add serilog as logging provider so that exceptions and automatically generated information are logged, too.

On server side I use

var builder = WebApplication.CreateBuilder(args); builder.Host .UseSerilog((ctx, lc) => { lc.ReadFrom.Configuration(ctx.Configuration); }); 

This way everything is passed to serilog.

UseSerilog is defined in Serilog.AspNetCore. Unfortunately, if I add Serilog.AspNetCore to my client project, the following error appears:

NETSDK1082 There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'

Is there a way to manually add serilog to logging providers, or in alternative, is there a way to add Serilog.AspNetCore package to client project?

Source Link
Disti
  • 1.6k
  • 2
  • 15
  • 41

User serilog as logging provider in blazor webassembly client app

I'd like to use serilog in a blazor webassembly net 6 app, both on client and server sides. In this article I found out how to relay log entries to server so that they are written in log files.

In this approach however the Log static class is used to explicitly add log entries.

I'd like to add serilog as logging provider so that exceptions and automatically generated information are logged, too.

On server side I use

var builder = WebApplication.CreateBuilder(args); builder.Host .UseSerilog((ctx, lc) => { lc.ReadFrom.Configuration(ctx.Configuration); }); 

This way everything is passed to serilog.

UseSerilog is defined in Serilog.AspNetCore. Unfortunately, if I add Serilog.AspNetCore to my client project, the following error appears:

NETSDK1082 There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'

Is there a way to manually add serilog to logging providers, or in alternative, is there a way to add Serilog.AspNetCore package to client project?

Thank you