Questions tagged [serilog-sinks-file]

86 questions
1
vote
0 answers

Serilog UWP Background Task

i'm having some issues using serilog while running a background task in an uwp app. I'm using appsettings to configure, but no log is being done. "Serilog": { "WriteTo": [ { "Name": "File", "Args": { "path":…
1
vote
0 answers

Performance concern due to serilog eventcollector

I'm considering to use serilog for my app. We have .net core 2.1 app. Want to push application logs to splunk. So I've options where I can use Serilog.Sinks.Splunk and push logs WriteTo.EventCollector (specific index is configured in splunk) Another…
winadi
  • 141
  • 1
  • 6
1
vote
1 answer

Serilog not writing to text file from console app

I have a Logging.Core class library with the following simple class. My aim is to share one configured logger between all other projects in the solution: public static class Logging { public static void Configure() { ILogger logger =…
ProfK
  • 49,207
  • 121
  • 399
  • 775
1
vote
0 answers

Serilog is creating two log files for two endpoints which are pointing to one physical file path

I'm using serilog for my .net core web api2.1 project. everything is working as expected in local but if i publish the code and if i create two endpoints which are pointing to same published code then serilog is creating two different logs for two…
Surya
  • 103
  • 1
  • 7
1
vote
0 answers

file logging using serilog .net core project

i am trying to use serilog for file logging on a .net core project, and I want to use a log file for events, and another log file for errors. Ill add the appsetting.json file: { "Serilog": { "MinimumLevel": { "Default": "Information", …
1
vote
0 answers

How to roll a log file when the file is inaccessible

In a .net-core console app, I'm using Serilog file sink for logging. For configuration, I provide a file path (F:\\log.json) for file sink to write logs. Assume that the specified file is read-only, I expect Serilog file sink to write logs on a new…
0
votes
0 answers

Log to file using Serilog including last 10 other logs with each error log

I would like to log using Serilog. I want logging that only logs error or higher such that when the error is logged it includes the last 10 logs along with it. I have made a proof of concept that works with the console. Here is the code. Circular…
Dave Barnett
  • 2,045
  • 2
  • 16
  • 32
0
votes
0 answers

Logging in All Controller and Class with .net Core SeriLog

I was going to get some information about SeriLog from you. I use it by integrating it on .net core application var _logger= new LoggerConfiguration() .WriteTo.Debug() .WriteTo.File(@"C:\log\bis\processlog.txt", rollingInterval:…
0
votes
0 answers

Unable to load Serilog.Enrichers.CorrelationId, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null since it is not strongly typed

I am trying to load Serilog from an assembly which is strongly typed and is in GAC. I am unable to load assembly Serilog.Enrichers.CorrelationId, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null, since this is not strongly typed. Error: Could…
NV13
  • 1
0
votes
0 answers

Serilog log output with custom formatting

I am attempting to create a custom template for logging JSON format and writing it to a file using the following tech stack in my environment: DotNet 6 - WebAPI Serilog My expectation for the log file is to have the following…
Prakash
  • 13
  • 6
0
votes
0 answers

unable to write log File with serilog

I have added the Serilog to this project but I tried to make it work to no avail the setting I am currently using on appssetings is the project is using ASP.NET Core 7 but it doesnt seem to work at all it allows me to read the log from console but…
PontiacGTX
  • 185
  • 2
  • 15
0
votes
1 answer

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 execute the program. The logging doesn't happen when…
Jesslyn
  • 696
  • 10
  • 25
0
votes
0 answers

Serilog rolling file - same file name for newest entries but roll older entries to fille 1, 2, etc?

I'm trying to set up Serilog to match what the team is used to, but it seems that the rolling file behavior in unexpected. We want the FancyApp.log file to always include the latest log entries, but older log entries (when the file size rolls over…
gakera
  • 3,589
  • 4
  • 30
  • 36
0
votes
1 answer

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 trace_001.txt. but i want the latest log always…
0
votes
0 answers

How to set mimimum level to serilog sinks in appsettings.json

Microsoft.Extensions.Logging Trace vs Serilog Verbose the workaround: https://github.com/Su-s/serilogworkaround this is the configuration in my appsettings.json "WriteTo": [ { "Name": "Console", "Args": { "outputTemplate":…