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
2 answers

C# two classes one serilog file

I have a problem I have two classes and I want to write both classes into a Serilog file. class Program { static void Main(string[] args) { Log.Logger = new LoggerConfiguration() …
user7725461
1
vote
2 answers

Serilog not working with Elasticsearch

I have installed Elasticsearch locally on my Windows 7 machine. It is working properly and I can query it using postman. Using Postman, I have also created an index called cmstest. This has a table called zdsf. If I get the mapping…
Yasir
  • 1,595
  • 5
  • 23
  • 42
1
vote
1 answer

serilog.sinks.mssqlservercore causes a FileNotFoundException

I'm trying to use Serilog.Sinks.MSSqlServerCore (1.1.0) with Serilog.Settings.Configuration (2.2.0). Serilog.Settings.Configuration works fine with sinks like File and Seq. As soon as I add Serilog.Sinks.MSSqlServerCore to the project.json and tries…
1
vote
1 answer

serilog sinks xamarin tag not visible in log

I'm using serilog/serilog-sinks-xamarin as described here In .Android project I added following code: Log.Logger = new LoggerConfiguration().WriteTo.AndroidLog().Enrich.WithProperty("Tag", "CustomTag").CreateLogger(); And calling it from…
1
vote
1 answer

what is difference between Serilog.Sinks.File and Serilog.Extensions.Logging.File?

what is difference between Serilog.Sinks.File and Serilog.Extensions.Logging.File packages in asp.net core? When I tried to implement logging in asp.net core project with Serilog I found a quick example here which used Serilog.Sinks.File. When I…
Mahesh Gupta
  • 457
  • 1
  • 6
  • 18
1
vote
1 answer

Upload a file generated from Web Services project to Azure Blob Storage

Currently i have a web services project, in the startup code I have created a logger from Serilog like so: public Startup() { Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() …
1
vote
1 answer

Serilog's enricher does not log properties

I have ASP.NET MVC application and im using Serilog for logging purpose. I have implemented serilog's enricher to log user's username for every log entry public class HttpContextEnricher : ILogEventEnricher { LogEventProperty _cachedProperty; …
LP13
  • 30,567
  • 53
  • 217
  • 400
1
vote
2 answers

Serilog Exceptionless Sink in .NET Core 1.1

How can the Serilog Exceptionless Sink be used with .NET Core 1.1? The Serilog.Sinks.Exceptionless README isn't clear and doesn't work for .NET Core 1.1 where I have put the configuration in the appsettings.json file. { "Serilog": { "Using":…
Boggin
  • 3,251
  • 3
  • 33
  • 48
1
vote
1 answer

Serilog and elasticsearch 5.0

I would like to use serilog to write to elasticsearch 5.0 Serilog already have a sink for this purpose at https://github.com/serilog/serilog-sinks-elasticsearch. Unfortunately this sink only works for elasticsearch v 2.x - it doesn't seem to work…
Misk
  • 157
  • 1
  • 2
  • 15
1
vote
2 answers

How to "skip" over void method with FakeItEasy?

I have this code in a method I´m unittesting public void SomeMethod() { IMyLogger log = new Logger(); log.ConfigLogger(); // Trying to not call this method //...some other code... } Where this is the Logger class public class Logger :…
Sturla
  • 3,446
  • 3
  • 39
  • 56
1
vote
1 answer

Serilog WriteTo.RollingFile seems to create 500 error code when I publish to Azure

I published a basic asp.net core app to Azure experimenting with Serilog but it gives me a 500 error after publishing. When I comment out the RollingFile Sink it publishes fine without error. Any reason why this might be happening? Also it works…
Benjamin
  • 77
  • 1
  • 6
1
vote
1 answer

Logging in multiple files with filters which are ignored

I have defined two Filters for a serilog LoggerConfiguration Both are RollingFile loggers which should, depending on the type write in a log file in another folder. var activityPath = @"C:\temp\Activities\log-{Date}.log"; var eventsPath =…
Mark
  • 3,273
  • 2
  • 36
  • 54
1
vote
1 answer

How are Serilog-enriched properties written to Azure Table Storage sink?

Following up to this comment. I've added Serilog to an Azure Service Fabric application and am using the Azure Table Storage sink as a stop-gap solution to something more production-grade. I'd like to enrich my log messages with information from…
alastairs
  • 6,697
  • 8
  • 50
  • 64
1
vote
2 answers

basedir in appsettings.json in asp.net core

I started my new project in ASP.NET Core and I have a question. I have 2 loggers: a) nLog, that have it's config in nlog.config file b) serilog, that have it's config in appsettings.json At this moment, I have 2 locations to store…
zchpit
  • 3,071
  • 4
  • 28
  • 43
1
vote
1 answer

Serilog writing to undetermined number of log files

I have a bunch of archives, each contains thousands of files to be processed. I want to write one log file as summary, one containing errors if any, and finally, for each archive, a separate log file with all entries processed. The first two can be…
Whoever
  • 1,295
  • 1
  • 14
  • 21