Skip to main content

Questions tagged [serilog]

Serilog is a .NET library which provides diagnostic logging to files, the console, and so-on. Consider using this tag along with the .net framework version you are using for extra clarity

serilog
1 vote
0 answers
18 views

serilog multi-process sharing not working --- .NET CORE APIs not able to write to the same error file

I have two .NET 8 CORE APIS ( API-1 & API-2), and I am trying to get them to log any error to the same file to no avail. Only one API is writting to the error file Test 1 Restart IIS Genereate ...
MCS's user avatar
  • 172
0 votes
0 answers
8 views

Serilog miss some logs in multiple instances environment

My environment is multi-instances. Here is the code logic: Reading a file(contain 15k of entries) -> insert into queue-A respectively with entry ID Instance pick up one entry from queue-A -> ...
paddywide's user avatar
1 vote
1 answer
21 views

How to add Serilog logging to a SignalR client?

Currently my hub builder looks like this: hub = new HubConnectionBuilder() .WithUrl(Constants.HubsUrl + "/MainHub", options => { options.Headers.Add(Constants.HeaderToken, ...
Ivan Debono's user avatar
0 votes
1 answer
23 views

Using Serilog to log at various levels of verbosity across namespaces and classes

I was led to believe that I can set a global minimum level of Information and then in particular namespaces or classes I could bump it up to Debug or even Verbose. This is the code: using Commons; ...
Mircea Ion's user avatar
0 votes
0 answers
17 views

How to provide index for Elastic.Serilog.Sinks

Since Serilog.Sinks.Elasticsearch has become obsolete, I am trying to get Elastic.Serilog.Sings to work. So I do this: var uris = new List<Uri>() { new Uri("http://a-good-url:9200") }...
iakob's user avatar
  • 351
2 votes
0 answers
53 views

Serilog and setting WriteTo configuraion

I am using serilog for my logging mechanism so in basics my Program cs looks like this; IHostBuilder builder = new HostBuilder() .UseSerilog((context, services, configuration) => ...
Wojciech Szabowicz's user avatar
0 votes
1 answer
48 views

How to add elapsed time in log using dotnet serilog?

I have a web application. And I wnant to log the response of serivces using logger. public class PrivacyModel : PageModel { private readonly ILogger<PrivacyModel> _logger; private ...
barteloma's user avatar
  • 6,763
0 votes
0 answers
22 views

How to log directly to Grafana Loki using Serilog with OpenTelemetry

I want to log from Serilog directly to Grafana Loki (no collector) using OpenTelemetry. Logging without OpenTelemetry to grafana works: .WriteTo.GrafanaLoki("http://localhost:3100", labels: ...
user963935's user avatar
1 vote
0 answers
45 views

Want to use WebHost and serilog in .NET 8

want to use serilog middleware in Webhost using belwo snippet. WebHost.CreateDefaultBuilder<Startup>(args) .UseConfiguration(configuration) .UseContentRoot(Directory....
jayakanth battu's user avatar
0 votes
0 answers
14 views

MSTest Serilog Console issue

I have a library C# project which has services written. This is using serilog and able to print serilogs on console during normal execution. But when I am using same library within my functional test ...
Himanshu Garg's user avatar
1 vote
2 answers
40 views

Adding extra properties to ILogger<T> structured logging

Using ILogger<T>, is there a way to add log properties in addition to the ones covered by the message template? For example: _logger.LogInformation("Order {OrderNumber} was registered."...
Sigurd Garshol's user avatar
0 votes
1 answer
58 views

Why I can't catch and log "Out of Memory" exception? [duplicate]

I'm running .net 6 application as a windows service like this: "C:\Program Files (x86)\dotnet\dotnet.exe" c:\MyApp\MyApp.dll Application is starting like this: var builder = WebApplication....
InfernumDeus's user avatar
  • 1,205
0 votes
0 answers
69 views

Limiting number of logs in a blob file in Azure functions log to Blob Storage

I am using Serilog to put responses I get in form of logs through swagger, to a file in Azure Blob storage container. Below is the startup.cs code (it was in program.cs but tried to add in startup for ...
Time cache's user avatar
0 votes
1 answer
75 views

Debugging MAUI Blazor App in Chrome style or getting errors seen

I try to migrate my web Blazor app to MAUI. I'm curious, if there is the way to see tools like Chrome 'Console', 'Network' etc. while debugging MAUI Blazor app on Windows? The source of the question ...
Electrionics's user avatar
  • 6,657
0 votes
1 answer
88 views

Duplicate log entries in Application Insights with Isolated Azure Functions with ASP.NET Core Integration and Serilog

I have a .NET 8 Azure Functions project in an isolated worker process with ASP.NET Core Integration. For logging I want to use Serilog and the ApplicationInsights sink so I'm able to log scoped ...
321X's user avatar
  • 3,193

15 30 50 per page
1
2 3 4 5
160