Questions tagged [structured-logging]

47 questions
1
vote
1 answer

How to write structured logs so that message field is used by GCP Log Viewer?

Question Is there a way to write structured logs from Cloud Functions such that the message field is automatically displayed as the primary message in GCP Log Viewer? Using this test, I've found that a field named message is sometimes used. For…
1
vote
0 answers

What are events in structured logs?

I'd like to know what events are in structured logs. Can only events trigger the different processors? I have tried looking up on python docs, but could not find more information regarding what constitutes as an event.
Ash Bain
  • 11
  • 1
1
vote
1 answer

What is the idiomatic approach for logging long messages in a structured logging system like MEL and Serilog?

My ASP.NET Core 2.x web-application makes idiomatic use of Microsoft.Extensions.Logging for doing "trace"-style logging when I want to store a short (<200 character) parameterised string. These kinds of logged events work well with the tooling and…
Dai
  • 141,631
  • 28
  • 261
  • 374
0
votes
0 answers

GCloud Logging Write - Json as String inside a Structured Logs JsonPayload.message Field

I am currently working with gcloud monitoring. I searched for a way to write log messages similar to already incoming logs. To mimic the real log entry, I am writing a log from a pod via "echo". My goal is to write a log entry with the following…
0
votes
1 answer

What method is called during Ilogger conversion of structured logging arguments to string?

I have an object that I want to pass to logging (default built-in logging to console, no libraries used) as argument like this: logger.LogDebug("Executing MongoDB command: {Command}", command); What I was expecting is that the result will be a call…
Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207
0
votes
1 answer

Add logging context to all Azure Function logs

By default, Azure Functions adds logging context data to all logs. Is it possible to add other context items to be logged globally? Specifically, I'd like to add global data such as the build number. I can't find any sort of hooks that don't require…
0
votes
0 answers

NLog: reference properties in message

I am using NLog with structured logging for the first time. I user Serilog in the past, and with that I could write something like this: Serilog.ILogger logger = CreateSerilogLogger(); logger.ForContext("MyProperty", "Some dummy value") …
maradev21
  • 576
  • 2
  • 6
  • 20
0
votes
0 answers

Is it possible to combine structured logging with string interpolation in C#?

I would like to do this: logger.LogInformation($"Calling {nameof(MyMethod)} for message {messageId}", messageId); So far it seems not possible to combine syntax for structured logging with interpolated string. Maybe I am missing something here and…
Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207
0
votes
2 answers

Structured Logging in Azure Functions

i am trying to get structured logging working in a Azure Function, but it does not work on my side. I wrote a simple application like this [FunctionName("Dummy")] public IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous)]HttpRequest…
0
votes
1 answer

Log4j2 (and SLF4j 2.0.0-alpha1) and JsonTemplateLayout--how to serialize Messages as JSON

I'm exploring Log4j 2.14.0 and SLF4j 2.0 and trying to generate structured messages. I've got my Appender set up with a slightly modified LogstashJsonEventLayoutV1.json,
Michael Kohout
  • 1,073
  • 1
  • 14
  • 26
0
votes
0 answers

Serilog Log Exception and Other Properties

I am implementing Serilog in a WCF Service application. In my Global.asax, I am trying to set up the global logger to print the time of the log, the thread ID, any exceptions of that may be logged, and the additional properties in json format…
jlat96
  • 491
  • 1
  • 5
  • 10
0
votes
1 answer

How to force camel case in C# .NET structured logging?

Does anyone know how to change the behavior/format of the structured logging in .NET Core C# to be camel case (ex: camelCase)? I'm trying to leverage structured logging like as follows: Logger.LogInformation("Some text here. My object:…
JVIH
  • 103
  • 1
  • 1
  • 8
0
votes
1 answer

Logback structured logging format timestamp via logback.xml

I want to format the timestamp in my structured logs. Currently I defined the logback.xml like:
xtra
  • 1,957
  • 4
  • 22
  • 40
0
votes
1 answer

How to implement structured logging when using NLog in wrapper class

I am having trouble figuring out how I can use the structured logging, when NLog is in a wrapper class. I have an asp.net webapp that calls my nlog wrapper class. It works fine for regular logging ex. logger.Info("Gets to here.") but i can't get it…
made_it_ma
  • 89
  • 9
0
votes
0 answers

Using Serilog contextual without dependency

I think the title could be a bit vague, but I couldn't come up with a better title. My use case is this: I have a Web API project, which is using some "library" projects, taking care of business logic, and I want to use Serilog and its LogContext to…
Farzad
  • 1,770
  • 4
  • 26
  • 48