102 questions
0
votes
1
answer
54
views
Serilog xml-based config sublogger not working
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 ...
1
vote
1
answer
147
views
Does Serilog support WinUI 3.0 Apps?
I am new to WinUI development, I created a new simple WinUI 3.0 app (using Viusal Studio template Blank App, Packaged (WinUI 3 in desktop)
I also installed the following
$ dotnet add package Serilog
$ ...
2
votes
2
answers
668
views
Serilog Seq and file Sink not working in maui (net9)
I want to use Serilog with file- and seq-sink in a .NET9 Maui app but both are not working. I already used it in an asp.net core web api project and it worked fine, so i tried to implement it in a ...
0
votes
1
answer
134
views
Logs are missing in .NET Core 3.1 Console Application using Serilog.Sinks.Async
In my .NET Core 3.1 console application, I am reading a large text file with records sequentially and logging the record number and other information using the below Serilog sinks:
"Serilog.Sinks....
1
vote
0
answers
91
views
Three ASP.NET Core Web API not able to share and write to the same file sink using Serilog
I have three ASP.NET Core Web APIs hosted in IIS on the same machine which use different configuration file to setup Serilog but all of them point to the same log file.
Here is an example of my ...
0
votes
1
answer
167
views
Why Serilog file suddenly doesn't write to file when reached 1000kb?
Here is the config
{
"Serilog": {
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "log.txt&...
0
votes
1
answer
917
views
Serilog Sink File with Filter not worked using the appsettings.json
WEB API, .NET CORE, C#, NET 8.0, SERILOG, SINK FILE, SERILOG EXPRESSIONS
Good morning,
as per demo attached here (https://github.com/serilog/serilog-sinks-file/issues/317) I have some problem to write ...
1
vote
0
answers
194
views
When Serilog logger methods throw an exception while writing log to audit file (Serilog.Sinks.File - Auditing via AuditTo)?
My team and I attempt to integrate auditing capability of serilog-sinks-file for our application.
We have the requirement to report failures in auditing mechanism. Therefore I try better understand ...
0
votes
1
answer
826
views
How to split Serilog log file into multiple files?
I'm trying to split logs by SourceContext.
After spending some days and reading the documentation and many, many, many posts, I have this config and not a solution:
"Serilog": {
"...
2
votes
0
answers
739
views
I can't generate the log file on MAUI app [SOLVED]
I use the serilog-sinks-file package to copy the logs into a ".log" file but it does not generate the directory or the file.
I added this code in "MauiProgram.cs" inside a empty ...
0
votes
1
answer
145
views
%DOCUMENTS% environment variable does not work in App.config file of a WPF application
I have a WPF application and want to use Serilog to log context in a local txt file. I have installed Serilog, Serilog.Sinks.File and Serilog.Settings.AppSettings packages.
After launching and ...
2
votes
3
answers
4k
views
How to log the classPath, methodName and lineNumber with Serilog in C#
I want to print log to file from my system (.NET Framework 4.6.1) I want to print this information: className, methodName, lineNumber from which log entry was Called.
I've a Serilog class:
`
...
0
votes
2
answers
486
views
Serilog File Sink not logging to file when ran as WindowService
I'm running a workservice as a window service, the log to eventlog is working, but it's not logging to file.
When ran in visual studio, it logs to both eventlog and to file.
What could explain this? ...
1
vote
2
answers
1k
views
Serilog retainedFileTimeLimit .net 6 is not working
I was trying to clear log files periodically. So, while searching in serilog.sink.file v5.0.0 I found out a something called retainedFileTimeLimit and I tried it but it didn't work.
This is my code -&...
2
votes
0
answers
355
views
Serilog - delete old logs without RollingFile
I need to have a single dedicated log file for each execution of an application - which may occur many times a day.
I set a different name to the log file on each execution by adding timestamp by code....
0
votes
1
answer
189
views
Serilog file sink not writing logging when executed from a sql job
The dilemma:
I've added logging to an existing console application for work that is executed every 5 minutes via a sql job. The logging has worked in development, testing, and production when I ...
1
vote
1
answer
2k
views
Serilog.Sinks.Async is spawning thousands of threads
We are using Serilog file sink and Elastic search sink that both use a Serilog async sink to make sure everything is handled in a background thread.
The last days we had server-wide issues and all ...
0
votes
1
answer
255
views
In serilog ,Is there any property to maintain the configured filename is latest log
Hi i am using serilog to write the log. Log captured perfectly, my problem with the log filename. I have configured log filename as trace.log. once the file limit is reached the latest log captured in ...
0
votes
0
answers
1k
views
serilog shared file with retainedFileCountLimit
I have very big solution that use ILogger<T> with serilog for each class, all of them write logs to same file with shared : true.
the problem is retainedFileCountLimit doesn’t work for me ...
3
votes
1
answer
3k
views
Logging using Serilog not creating logs in .NET Core 6 using 'Serilog.Sinks.File' option, while working in .NET Core 5
I am using Serilog.Sinks.File in .NET Core 5 and it is working fine.
In .NET Core 5, I am using the subsequent configuration,
startup.cs
public void Configure(IApplicationBuilder app, ...
1
vote
1
answer
621
views
How do I add the failureSink to elasticsearchSink
I add FileSink as failureSink to ElasticsearchSink from appSettings.json. But "Cannot create instance of type 'Serilog.Core.ILogEventSink' because it is either abstract or an interface." I ...
2
votes
1
answer
3k
views
How to create new log folder for each day using SeriLog
I am using SeriLog in my .Net6 application.
I am trying to create a serilog json configuration that will help me create a new log folder each day.
Then the logs for that day will be created in the ...
1
vote
0
answers
220
views
Serilog Condition writing to file based on global minimum level
I'm trying to log my events in two different files based on the global minimum level set in the logger:
>= Debug to a debug file
>= Information to another file.
I control the minimum level ...
2
votes
1
answer
853
views
Maintaining a (single) stable filename using Serilog File sink
I am logging the data like below :
.WriteTo.File("log.txt", rollOnFileSizeLimit: true,retainedFileCountLimit: 1,
fileSizeLimitBytes: 10)
This ...
0
votes
1
answer
861
views
How to keep user infos in log using Serilog
I'm trying to show request and response in logs using Serilog in .Net Core MVC 6. But also I need to show the user's informations. How can I show it I've never used logging before?
Program.cs
var ...