Questions tagged [rollingfilesink]

This is a type of sink available for the Serilog logging library. Events logged using a logger configured with such a sink will be sent to a file on disk which is automatically rolled over on a daily basis.

11 questions
15
votes
1 answer

Serilog - Possible to Change DateTime/Timestamp Format in RollingFile Sink

The Current Output of RollingFile Sink for Date time is as follows 2015-04-06 18:40:54.400 +10:00 [Information] Hello World! Is there anyway to remove the TimeZone Offset? +10:00. To Achieve the following output; 2015-04-06 18:40:54.400…
Aaron Glover
  • 1,199
  • 2
  • 13
  • 30
12
votes
7 answers

Serilog - RollingFile Sink does not roll files based on date and size

I am using Serilog - RollingFile Sink, but it stores all data in a single file for a day. In my application, 1 GB log is written in a day. So I want to roll log file on the basis of date and size. How can I configure RollingFile Sink to roll files…
user1780538
  • 900
  • 3
  • 13
  • 22
11
votes
3 answers

'Serilog' already has a dependency defined for 'Microsoft.CSharp'

I am trying to install serilog and I'm getting error PM> Install-Package Serilog Install-Package : 'Serilog' already has a dependency defined for 'Microsoft.CSharp'. At line:1 char:1 + Install-Package Serilog + ~~~~~~~~~~~~~~~~~~~~~~~ …
LP13
  • 30,567
  • 53
  • 217
  • 400
8
votes
2 answers

Serilog machine name enricher for rolling file sink

I'm trying to use a couple of enrichers (machine name and thread ID for now) in conjunction with a rolling file sink and a Loggly sink. Whilst the Loggly events correctly contain the machine name and thread ID properties, I can't see these in the…
CyberDude
  • 8,541
  • 5
  • 29
  • 47
4
votes
1 answer

Serilog - can not log to multiple files based on property

Hello i am trying to log some messages in a file and others in another file using Serilog. I have tried the following configuration: Log.Logger = new LoggerConfiguration() .WriteTo.Map("type", "audit", (name, x) =>…
Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152
3
votes
2 answers

Serilog File Sink - System.MissingMethodException: Method not found: Serilog.LoggerConfiguration

I'm getting a MissingMethodException when I try to use the File Sink. Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .WriteTo.File(logFilePath, rollingInterval: RollingInterval.Day, shared:…
Andrea Tassera
  • 359
  • 3
  • 17
3
votes
1 answer

Flink BucketingSink with Custom AvroParquetWriter create empty file

I have created a writer for BucketingSink. The sink and writer works without error but when it comes to the writer writing avro genericrecord to parquet, the file was created from in-progress, pending to complete. But the files are empty with 0…
jlim
  • 909
  • 2
  • 12
  • 24
2
votes
1 answer

How to initialize retainedFileCountLimit indefinitely from config

Trying to convert the following code configuration into a config line: .WriteTo.RollingFile(@"C:\Foo\Bar-{Date}.txt", retainedFileCountLimit: null) The documentation for the rolling file sink states that in order to retain the logs indefinitely one…
CyberDude
  • 8,541
  • 5
  • 29
  • 47
1
vote
1 answer

Serilog creates a new file after 2 KB

I am using rolling file sink. Following is my code of initialization: Serilog.Log.Logger = new LoggerConfiguration() .WriteTo.RollingFile(@"L:\logs\Api-{Date}.txt", fileSizeLimitBytes: null) .CreateLogger(); Here is the line…
user1780538
  • 900
  • 3
  • 13
  • 22
0
votes
0 answers

Using Spark dataframe how to control output file size when saving text or json to S3

I need to a way to control the output file size when saving txt/json to S3 using java/scala. e.g. I would like a rolling file size of 10 mb, how can i control this using dataframe code, I have experimented with spark.sql.files.maxPartitionBytes.…
Vms
  • 199
  • 2
  • 11
0
votes
1 answer

SeriLog fileSizeLimitBytes attributes asp.net Core

We are using asp.net Core 1.1 and are using SeriLog to create log file within the application. Now to control size of log file, I added attribute fileSizeLimitBytes "Serilog": { "MinimumLevel": "Debug", "WriteTo": [ { "Name":…
Manish Joisar
  • 1,256
  • 3
  • 23
  • 47