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 destructuring generated message contracts

It seems that the serilog cannot deconstruct classes (contracts messages) automatically generated by Visual Studio when a service reference is added. They are always serialized with unknow _typetag "fields": { "Request": { "_typeTag":…
1
vote
3 answers

Serilog sink for Oracle

I've been looking for a serilog sink for connecting to Oracle but no find anyone. Is there some way to connect with an Oracle database? If not, is possible to connect at least with MySql?? Thanks,
Maz
  • 41
  • 1
  • 5
1
vote
1 answer

Is it possible to instruct Serilog to dump each log entry to a separate json file?

I am developing a service, which has to dump each log entry as a separate json file. Then, all these dumped log files will be imported to ElasticSearch. I am aware of ElasticSearch sink, but the idea is not to lose logs when ElasticSearch is…
maksmara
  • 27
  • 6
1
vote
1 answer

Log failover with Serilog

Is it possible, using Serilog, to log to a webservice of mine and if throws an error (no internet, for instance) to log to a RollingFile. Should only log to RollingFile if WebService fails.
hpinhal
  • 512
  • 6
  • 22
1
vote
1 answer

Getting the value of correlation Id from Serilog programatically

I am using Serilog for logging in my Web API project, with the web classic nuget package installed I am simply able to log a unique GUID value per request. From my Logger is there anyway to access that value? I know that any time I am writing to a…
TechNerd
  • 910
  • 1
  • 10
  • 19
1
vote
1 answer

Logging properties to Serilog Email Sink

Is there a way to configure the Serilog email sink to also include the additional properties in the email body? I can see the default format is: {Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception} But I am not sure if…
chrisb
  • 1,395
  • 1
  • 14
  • 35
1
vote
1 answer

How to add an outputTemplate in code with Serilog?

How would I add in an outputTemplate into this code? Serilog.Log.Logger = new LoggerConfiguration() .MinimumLevel.Information() .Enrich.WithMachineName() .WriteTo.Sink(new…
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30
1
vote
0 answers

Serilog with WP8.1

I'm trying to use Serilog in a WP8.1 app. There are no functions like var log = new LoggerConfiguration() .WriteTo.RollingFile("log-{Date}.txt") .CreateLogger(); when creating the LoggerConfiguration. The only chance to write the log to file is to…
dtoth
  • 13
  • 5
1
vote
0 answers

ElasticSearch with Serilog?

I'm trying to use Serilogger together with Elasticsearch and I'm clueless on how to get these to work together. [2015-06-02 12:45:49,149][DEBUG][action.bulk ] [Jimaine Szardos] [logstash-2015.06.02][4] failed to execute bulk item…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
1
vote
1 answer

Unable to use Serilog in Controller in asp.net 5

How can I use Serilog from Controller itself? I have added this in my Configure method in Startup class : var serilog = new Serilog.LoggerConfiguration().MinimumLevel.Debug().WriteTo.File("C:/Temp/log.txt"); logFact.AddSerilog(serilog); I also…
zoranpro
  • 453
  • 4
  • 18
1
vote
3 answers

Serilog Email Sink to use for sending email via Office 365

I am trying to use Serilog's Email sink as part of simple console application. This application has very short lifetime: it checks DB and updates subscribers with a new data. I want to send an email if error happens. The problem is that if I don't…
1
vote
1 answer

Serilog to LogEntries MachineName and ThreadId are not being logged

I am using Serilog to log to LogEntries.com but when I configured the Serilog to send entries enrich with MachineName and ThreadId, they did not show up in LogEntries entries. How does the entry being sent to LogEntries get formatted. Do I have to…
ozone
  • 311
  • 2
  • 9
1
vote
1 answer

How to bypass template formatting in Serilog?

I would like to insert a simple newline into a Serilog log file without any default template formatting. How can this be done? I tried creating an additional logger without formatting but it did not seem to work correctly with multiple loggers to…
Magnus Lindhe
  • 7,157
  • 5
  • 48
  • 60
1
vote
0 answers

Why is Serilog(.Extras.)Web's ApplicationLifecycleModule.Init() called twice?

I'm hosting a Web API in IIS (7.5) as an Application under "Default Web Site", and am using several of the Enrichers from Serilog.Extras.Web (I'll be upgrading soon to the SerilogWeb.Classic package). I noticed in my logs that…
David Rubin
  • 1,610
  • 1
  • 17
  • 28
1
vote
1 answer

Can I use Serilog.Extra.Web's HttpRequestNumber or HttpRequestId as the SerilogMetrics timed-operation identifier?

I'm using SerilogMetrics's BeginTimedOperation() in a Web API, and it would be really great to be able to use the HttpRequestNumber or HttpRequestId properties (from the respective Serilog.Extra.Web enrichers) as the identifier, making it super easy…
David Rubin
  • 1,610
  • 1
  • 17
  • 28
1 2 3
99
100