Questions tagged [serilog-expressions]

9 questions
4
votes
1 answer

Serilog Filter Sink by Custom Property

I want to use Serilog.Expressions to filter my logging for a specific sink. In this instance, I only want to log to the Console Sink if my custom property MethodName is equal to "SomeOtherTask". Serilog is still logging to both Sinks for DoSomeWork…
mr.coffee
  • 962
  • 8
  • 22
2
votes
1 answer

Serilog Expressions output template newline in Azure Function app

I have just added the Serilog Expressions package to my Azure Function App, so that I could use the ability to shorten the SourceContext down to just the class name (which works beautifully btw). The function app has its config parameters stored in…
2
votes
1 answer

How to make Serilog pick up both the expression template and a console (color) theme from appsettings.json

I'm trying to configure Serilog for my ASP.NET app using appsettings.json and am following the instructions from the GitHub Serilog.Settings.Configuration project readme. I cannot get the Console output format expression working from…
1
vote
0 answers

Serilog: is there an ExpressionTemplateParser to extract tokens?

I'm trying to develop my own sink, but I'm stuck in the tokens extraction step which I need in order to customize rendering style (colors etc). In a normal message template I can call MessageTemplateParser, but I didn't saw any equivalent parser for…
netcorefan
  • 311
  • 3
  • 6
1
vote
0 answers

Serilog.Expressions how to use the wildcard indexing (any) operator on a dictionary

I'm using Serilog.Expressions (3.4.0) to try to filter SQL injection attacks appearing in the query string. I've enriched the log event with the query string as a dictionary. It appears in my output as: QueryString: { someKey: "UNION ALL SELECT…
hobwell
  • 538
  • 1
  • 8
  • 26
1
vote
1 answer

How to Filter serilog with UseSerilogRequestLogging

I'm using serilog and try to filter out HTTP Methods that are not POST, GET, PUT, and DELETE. for example filter out OPTIONS Method. I also use UseSerilogRequestLogging and Serilog.Expressions. Everything work fine, Serilog is great. But the filter…
Citizen-Dror
  • 843
  • 9
  • 17
0
votes
1 answer

Is there a way to reference an appsettings value within the Serilog section in appsettings?

Using Serilog.Settings.Configuration (and presumably Serilog.Expressions) is it possible to reference another appsettings value? I'm trying to dynamically set endpointUrl below without duplicating the BaseUrl value or specifying the value outside of…
0
votes
0 answers

Serilog Filter Expression: Filter expression doesn't work as expected with "... is not null"

I have configured my serilog configuration in appsetting.json here is how I did : // Configuring Serilog "Serilog": { "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.MSSqlServer", "Serilog.Expressions" ], "MinimumLevel": { …
0
votes
0 answers

Does the Serilog console sink support expressions?

I'm trying to output to console by configuring the sink as follows: { "Name": "Console", "Args": { "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console", "Formatter": { "Type":…
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263