Questions tagged [serilog]

Serilog is a .NET library which provides diagnostic logging to files, the console, and so-on. Consider using this tag along with the .net framework version you are using for extra clarity

Serilog is a library that provides diagnostic logging to files, the console, and so-on. It is easy to set up, has a clean API, and is portable between recent .NET platforms.

Unlike other logging libraries for .NET, Serilog is built with structured log data in mind. Parameters passed along with log messages are not destructively rendered into a text format. Instead, they're preserved as structured data that can be written in document form to a data store.

Useful links

2233 questions
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
1
vote
1 answer

Query existing index from elasticsearch using NEST

We have an elasticsearch installation with kibana and I was wondering if I can write a query using NEST to display the log files a .Net program? I have tried creating a simple LogMessage POCO class to extract the messages but without success.…
resp78
  • 1,414
  • 16
  • 37
1
vote
1 answer

Serilog, Loggly-csharp, FullNetFx

I've got a .net 4.5.2 application where I'm trying to integrate with Serilog and Loggly. Unfortunately I'm getting the following error: Additional information: The configuration is invalid. Creating the instance for type IApplicationLog failed.…
SKN
  • 95
  • 1
  • 6
1
vote
2 answers

Is there a way to configure Serilog sub loggers via configuration file?

Currently I have all configuration written in code. I use subloggers for filtering and changing the storage of logging. Is there any way to do it from configuration file. Because I want to have a separate config file for every context in solution.
1
vote
1 answer

write-to not working from AppSettings with Serilog 2.1

I used Serilog 1.x and following worked there: In code: Log.Logger = new LoggerConfiguration().ReadFrom.AppSettings().CreateLogger(); In app.config: But…
Lassi Autio
  • 1,147
  • 1
  • 13
  • 35
1
vote
1 answer

Sending PowerShell exceptions to Serilog

This questions is in regards to how to log a PowerShell exception in Serilog so that it's interpreted as a fist-class property and not a large string. I have a few issues: To get the full exception information I need to expand the properties of an…
1
vote
0 answers

Log for context based on a module

I'm using Serilog to log events across my application. This application is composed of different modules (it's an MVC application) that we can consider Area of the application. I was wondering if it's possible to add a context information local to…
advapi
  • 3,661
  • 4
  • 38
  • 73
1
vote
1 answer

Can't use my custom Sink with config

I'm tring to use my custom sink for serilog via app.config but with no luck. I've a class library with a TestSink class defined as public class TestSink : ILogEventSink { public TestSink() { } public void Emit(LogEvent logEvent) …
advapi
  • 3,661
  • 4
  • 38
  • 73
1
vote
1 answer

Serilog - Include Custom Information Before JSON String for FileSink

I have a format that I need to follow for logging. I am writing out to the FileSink with a Serilog.Log.Logger = new LoggerConfiguration() .WriteTo.Sink(new FileSink(ConfigurationManager.AppSettings["serilogPath"],new…
Bran
  • 617
  • 8
  • 21
1
vote
1 answer

Serilog.Sink.LogEntries doesn't work when run on mono on Ubuntu

I want to use Serilog together with LogEntries. This works fine when I run the App on a Windows PC, but when building and running on mono on ubuntu 14.2 no messages are received at LogEntries. As a second slog sink I have configured console output…
Thomas
  • 8,397
  • 7
  • 29
  • 39
1
vote
1 answer

Serilog separate rolling files for each SourceContext

this is my serilog configuration : Log.Logger = new LoggerConfiguration() .WriteTo.RollingFile(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, …
Manoochehr Dadashi
  • 715
  • 1
  • 10
  • 28
1
vote
1 answer

Serilog property enrichment but still required in call to actual write call?

I am adding Serilog to our logging infrastructure and am confused by the following: public class OzCpWriteEntryExInput : OzCpAppServiceInputBase { private readonly ILogger _Logger; /// /// Class constructor ///…
TheEdge
  • 9,291
  • 15
  • 67
  • 135
1
vote
1 answer

Logentries + Xamarin = how?

The main question is: how to integrate Logentries in a Xamarin-based mobile app? Below two ways are taken into consideration: Serilog and log4net. Logentries supports Android, iOS, WP natively but not when those APIs are proxified using Xamarin.…
Ivan Caravanio
  • 597
  • 1
  • 7
  • 20
1
vote
1 answer

Serilog: Time to Live in mongoDB Capped Collection?

How does Serilog implemented period for capped collection? See this code: Log.Logger = new LoggerConfiguration() .WriteTo.MongoDBCapped( database: database, restrictedToMinimumLevel:…
Matthias
  • 1,386
  • 3
  • 24
  • 59
1
vote
1 answer

Logging client log output a NoDB using a WebService

I've a WPF application that runs on an intranet and al communications to the DBs are done via REST webservices. Since for audit purpose I need to store users activities (logs from Information to Fatal logs) to a NoDb instance (Seq or RavenDB). I've…
advapi
  • 3,661
  • 4
  • 38
  • 73
1 2 3
99
100