Questions tagged [serilog-sinks-file]

86 questions
5
votes
3 answers

Serilog ThreadId is always output as 1

I have a ThreadId in the outputTemplate but the log always records it as 1. I have several instances of the app running at the same time into the same log and so was hoping I could separate the instances based on the ThreadId. Can anyone suggest how…
KAHartle
  • 125
  • 1
  • 6
4
votes
2 answers

Serilog not creating log file on production server

I've created a C# .net5.0 console application and during testing Serilog has been working without incident, logging to Console and File (same folder; path="log.txt"). However, when I run on the application on our server, neither Console nor File…
Chris Walsh
  • 3,423
  • 2
  • 42
  • 62
3
votes
1 answer

app.UseSerilogRequestLogging() method not working

I am using IApplicationBuilder.UseSerilogRequestLogging() for request logging. I have configured File as sink. But it is not working. I can see every other log events but there is no Event logs that are generated by UseSerilogRequestLogging(). Even…
3
votes
1 answer

Serilog date in UTC format

I want to configure Serilog to log date in UTC format but currently the timezone of the server is used. We are using the following configuration file: { "Serilog": { "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ], …
Sheinar
  • 362
  • 3
  • 14
3
votes
1 answer

Console Application and missing Log File when using WriteTo.File()

I've written a C# console application that is being called by another program when that program completes. My application is quite simple in that it accepts a number of command line arguments and then does some processing. I've added Serilog today…
Phil Bevan
  • 56
  • 4
3
votes
2 answers

How to use Serilog for non Host based Console Application

I am using below code for accessing the Serilog for non Host based Console application..I have two requirement to achieve. I should be able to access MS extension Logger in all the other classes once Serilog is initialized. We should be able to see…
3
votes
3 answers

View Serilog logs in Windows Forms application

I have a C# Windows Forms application that is referencing a DLL (managed code) that is using SeriLog to log events. The SeriLog logger is defined in the Windows Forms (main) application, so I have control over the type of sink I am using. Currently…
Fritz45
  • 752
  • 1
  • 10
  • 23
3
votes
0 answers

How to configure rolling serilog-sinks-file to keep the latest log file with the same name

I like to have an editor open with the latest log file, while my application is running. I have a 10MB file size limit and Day as the rolling interval. When the first file, say log-20210314.log fills up and serilog starts a new one, the new one has…
John
  • 6,701
  • 3
  • 34
  • 56
2
votes
0 answers

How to get full path name of Serilog log file?

I am prototyping using Serilog in a .NET 7 console app. For a number of existing console apps, we copy, email, or otherwise process log/results files. So, I'd like to get the fully qualified filename of the log file that Serilog has written to. …
Margo Noreen
  • 396
  • 1
  • 3
  • 12
2
votes
1 answer

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, IWebHostEnvironment env, ILoggerFactory loggerFactory) { …
2
votes
1 answer

Adding Serilog to Azure Function App and logging to a file?

I am trying to add Serilog to an Azure Function app (.Net 6.0) and of course its not writing to a file. When I run the program, I can see in the console '[15:58:00 INF] Hello World!'. So then why not to the file? My other question is why do I see…
PKonstant
  • 834
  • 2
  • 15
  • 32
2
votes
0 answers

Single log for each file Serilog - FileSink class Obsolete Error

I want to create a seperate log file for each HTTP request made to the application. When ever a request is made to the application, it has to generate a log file in the following…
Hyder Ahmed
  • 149
  • 2
  • 14
2
votes
0 answers

Asp.Net Core Web Api - Serilog doesn't work after deploying on iis

Log works well locally. This is how I deploy to iis: Right click on Visual Studio project > publish to "publish" folder Copy all files from "publish" folder to the server as zip. On the server > open iis > stop that specific website Delete the…
coder
  • 4,121
  • 14
  • 53
  • 88
2
votes
1 answer

Amazon S3 sink in serilog is not working. How to use s3 Sink with serilog?

public class program { public static void Main(String args[]) { var levelSwitch = new LoggingLevelSwitch(); levelSwitch.MinimumLevel = LogEventLevel.Information; try { var logger = new…
Sonu Tomer
  • 23
  • 2
2
votes
1 answer

Why do I get Serilog SelfLog error while using Serilog logging?

I have an interesting error while using Serilog SelfLog. The error is: Application: XXX.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.IOException at…
1
2 3 4 5 6