Skip to main content
Filter by
Sorted by
Tagged with
Best practices
1 vote
1 replies
49 views

I have a CLI app in .NET, built with Spectre.Console.Cli package. I use ServiceCollection with Spectre ITypeResolver and ITypeRegistrar interfaces to wire up the DI. That works great, but now I want ...
roten's user avatar
  • 420
1 vote
1 answer
33 views

Working version: private static void SetLogging(WebApplicationBuilder builder) { Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext() .MinimumLevel.Override("...
SydneyShoo's user avatar
1 vote
1 answer
107 views

The code snippet below: Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext() .MinimumLevel.Verbose() .WriteTo.Console(outputTemplate: "{Timestamp:HH:mm:ss} [{Level:u3}] {Message}{...
mike's user avatar
  • 3,214
1 vote
0 answers
44 views

I've been unable to figure this one out and am wondering if anyone has any ideas. This is an ASP.NET Core Web API running as a Windows service. It will log to a file at the absolute path I specify for ...
Pete's user avatar
  • 33
0 votes
1 answer
54 views

I would like writing regular logs to log.csv, statistics info to separate log files. (.NET Framework 4.7.) Instantiated in code - I want to keep it minimal and have purely xml-based config. Log.Logger ...
Nickolodeon's user avatar
  • 2,966
0 votes
0 answers
30 views

I am trying to enable Serilog Tracing (serilog-tracing 2.3.1) in our system. It works well with http communication between our internal processes in my experiments. However, one of our components is ...
bit0001's user avatar
  • 554
0 votes
1 answer
45 views

I have an ASP.NET Core MVC app using Serilog. Sinks are configured in the appsettings.json. I have a few sinks. One of the sinks is not behaving. Typically I would overwrite the values of the ...
Skip Saillors's user avatar
1 vote
0 answers
59 views

I have a .net 8 api, using serilog to log various events. Also have several sinks defined, console, file and SQL server The issue I am having is that it appears that the first sink in the config file ...
JoLab's user avatar
  • 31
2 votes
1 answer
109 views

My Program.cs file looks like this: public class Program { private static IConfigurationRoot _apiConfiguration = null!; public static async Task Main(string[] args) { try {...
KKS's user avatar
  • 3,649
4 votes
1 answer
179 views

Question from the title. I'm trying to set up correlation Ids for my incoming requests. I have created a middleware, and set up a Serilog Enricher via EnrichDiagnosticContext (see code below). ...
cezarlamann's user avatar
  • 1,593
1 vote
0 answers
58 views

I'm using Serilog to log to a SEQ server via a custom sink in my C# application. Many functionalities, including RPC server implementations, are derived from a company library, .Tools. I'm ...
FlorianD's user avatar
  • 113
-5 votes
1 answer
59 views

I'm looking for the easiest / most elegant way to force log output for startup and shutdown events, regardless of the current output log level. This is so that logging to file will always have startup ...
PieterV's user avatar
  • 621
0 votes
0 answers
94 views

I have an ExpressionTemplate that allows for ..dynamicProps as part of a log message. This code is in my Program.cs file. string jsonTemplate = "{ { timestamp: @t, level: @l, message: @m," ...
twreynol's user avatar
  • 507
3 votes
1 answer
146 views

I have a standard MessageTemplate that is defined in my Program.cs class that includes the usual properties: string jsonOutputTemplate = "{ { ts: @t, lvl: @l, cid:CorrelationId, msg:@m, @x } }\n&...
twreynol's user avatar
  • 507
0 votes
1 answer
81 views

I get no log output at all on my release app. Even when logging with logger.LogError() there is nothing added to any log file. I'm currently using Serilog for the first time inside a MAUI 9.0.40 ...
Sebastian's user avatar
  • 279
0 votes
1 answer
81 views

I used to hide my SQL database logs from Console/Debug by adding this line of code in the Program.cs: builder.Host.UseSerilog((builderContext, config) => { config.ReadFrom.Configuration(...
Mihai Socaciu's user avatar
1 vote
1 answer
289 views

I have an ASP.NET Core 8 Web API that is installed as a service using the following method: var processInfo = new ProcessStartInfo { FileName = "cmd.exe", ...
Zippy's user avatar
  • 1,836
0 votes
1 answer
91 views

I use Serilog for logging and want to write to Console and Application Insights. Everything works fine on localhost. I see the logs in Console. But when I deploy it to Azure the App failed to start: &...
Uwe Becker's user avatar
1 vote
0 answers
146 views

I'm working on a ASP.NET Core MVC application and would like to use Serilog both for logging trace messages (Information) and Exceptions to Application Insight. The configuration code (from Program....
user29807957's user avatar
0 votes
2 answers
118 views

I'm working on an ASP.NET application and using Azure AppInsights and Serilog Sink https://github.com/serilog-contrib/serilog-sinks-applicationinsights for pushing the logs. However one problem I have ...
Yehia A.Salam's user avatar
1 vote
0 answers
112 views

I have switched from Serilog.Sinks.Elasticsearch package to Elastic.Serilog.Sinks. Before I would specify target index name like this: string indexFormat = settings.IndexName; configuration ...
Nick Farsi's user avatar
0 votes
1 answer
81 views

I currently use Serilog with the Ilogger extension where I log information in my .net core api. As part of a requirement all logs that have a user registered must include the UserId in its logging. ...
James Andrew Smith's user avatar
0 votes
1 answer
151 views

I am learning Azure Function Apps. My function app is a timer trigger that writes logs to datadog. The issue I am facing is related to the version incompatibility. The below works (I can see logs on ...
K G's user avatar
  • 69
0 votes
2 answers
198 views

I'm using Serilog to log information on my app. I'm using an appsettings.json file (see below) to setup the configuration settings of the logger. In that file, I have two configurations - one for ...
andyopayne's user avatar
  • 1,378
1 vote
1 answer
146 views

I added SEQ Tracing by using SerilogTracing in an ASP.NET Core 7 Web API using following code in program.cs: var logger= new LoggerConfiguration() .ReadFrom.Configuration(configuration); using var ...
Kamran Asim's user avatar

1
2 3 4 5
50