Questions tagged [semantic-logging]

Designed to provide to .NET developers a strongly-typed (semantic) logging approach, making it easier to consume logging information, especially when there is a large volume of log data to be analyzed.

What is Semantic Logging?

Semantic Logging (formerly know at the Semantic Logging Application Block or SLAB) is designed by the patterns & practices team to help .NET developers move from the unstructured logging approach towards the strongly-typed (semantic) logging approach, making it easier to consume logging information, especially when there is a large volume of log data to be analyzed. When used out-of-process, Semantic Logging uses Event Tracing for Windows (ETW), a fast, lightweight, strongly typed, extensible logging system that is built into the Windows operating system.

Semantic Logging enables you to use the EventSource class and semantic log messages in your applications without moving away from the log formats you are familiar with (such as database, text file, Azure table storage). Also, you do not need to commit to how you consume events when developing business logic; you have a unified application-specific API for logging and then you can decide later whether you want those events to go to ETW or alternative destinations.

How do I use Semantic Logging?

Official releases are available via NuGet. You can also head to msdn.com for additional information, documentation, videos, and hands-on labs.

Building

To build the solution, clone the Github repo and run msbuild.exe from the project’s build folder. You'll need to use the Visual Studio Developer Command Prompt. Some of the unit tests require a SQL database.

How do I contribute?

See CONTRIBUTING.md in for more details.

Release notes

Release notes in each release are available.

You can use its Gitter for quick questions.

36 questions
9
votes
4 answers

How can I organize EventSources for the Semantic Logging Application Block?

The Semantic Logging Application Block (SLAB) is very appealing to me, and I wish to use it in a large, composite application I am writing. To use it, one writes a class derived from 'EventSource', and includes one method in the class for each event…
ProfK
  • 49,207
  • 121
  • 399
  • 775
7
votes
2 answers

EventSource/Enterprise Library Logging caches deleted methods, (possibly in a instrumentationManifest!)

Short version If I change this ... EventSource(Name="BasicLogger") public class BasicLogger : EventSource { ... } to this ... EventSource(Name="HardymanDatabaseLog") public class BasicLogger : EventSource { ... } ... I still receive log messages,…
4
votes
1 answer

Semantic Logging Application Block with Log4Net?

Is there a way to redirect events logged using the Semantic Logging Application Block to a Log4Net listener? What I want to do is fully instrument my libraries for SLAB, but in a way that doesn't force my Log4Net users to fully adopt SLAB.
Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447
4
votes
1 answer

EventSource is not logging

I am using the Semantic Logging Application Block, and I have the following two EventSource based classes (inner constant classes omitted for brevity: [EventSource(Name = EventSourceNames.Prism)] public sealed class PrismEventSource: EventSource { …
ProfK
  • 49,207
  • 121
  • 399
  • 775
3
votes
1 answer

Semantic Logging Analyzer exception number of WriteEvent arguments and event parameters are different

This fragment makes the Semantic Log Analyzer throw "The number of WriteEvent arguments and event parameters are different in event name 'HandlingCommand'." [NonEvent] public void HandlingCommand(Command command) { if (this.IsEnabled()) { …
gumaflux
  • 330
  • 2
  • 13
3
votes
1 answer

Semantic Logging using ETW with Custom Keywords not logging

I am trying to use .Net 4.5, Semantic Logging (SLAB) EventSource, to create events with custom keywords. I would like to use Out-of-Process, and use the keywords to steer events to logfiles or SQL. I have used EventSourceAnalyzer against this…
BillH
  • 421
  • 3
  • 7
2
votes
1 answer

.Net Core 1.1 not serializing object while logging

I have ASP.NET Core 1.1 application and i am using Serilog for logging. I want to log DTO object by preserving its structure. So If i directly use Serilog.Log to log the DTO, like below Serilog.Log.Information("Processing {@DTO}", dto); Then…
LP13
  • 30,567
  • 53
  • 217
  • 400
2
votes
1 answer

"EventSourceException" with no details on every log, but the log itself still comes through

So I'm using SLAB and I have a Database listener logging out to a database. I'm testing with a single method on the event source. The issue that I'm having is that the log is being inserted into the database just as I want it, but I'm also getting…
Sinaesthetic
  • 11,426
  • 28
  • 107
  • 176
2
votes
2 answers

How to store the payload in separate columns using the Semantic Logging Application Block's SqlDatabaseSink

How can the SqlDatabaseSink store the payload in separate columns? It's mentioned in the documentation, but I haven't seen it done anywhere. When I've tried, the payload is always stored as a JSON string. Any ideas? Source: Developing event…
2
votes
2 answers

How to create database for a Semantic Logging Application Block with SqlDatabaseSink

How to set up the SQL Server database for Semantic logging. Does the table for logging information needs to be created earlier? If yes, what is the schema to be used. I have the following code : var listener = new ObservableEventListener(); string…
1
vote
0 answers

In NLog fluent logging, how can I force a log property to be rendered as JSON?

I'm using NLog to create semantic logs in a Seq server. I want to log an object that has a ToString() method that produces a short human readable summary of the data content. So I want to render the object as a string when formatting it using the…
Tim Long
  • 13,508
  • 19
  • 79
  • 147
1
vote
1 answer

SemanticLogging throws Exception in Command Processing for EventSource

On some machines (probably only on Windows 7 and 2008 R2 but not on Windows 10) I have problem using SemanticLogging. When I run it I'm receiving fallowing output: Event Trace Session prefix: Microsoft-SemanticLogging-Etw Sink name:…
Maciej Zawiasa
  • 189
  • 2
  • 6
1
vote
1 answer

OpCode is being attached to event name in out-of-process Semantic logging (SALB) c#

I am doing an out-of-process semantic logging with elastic search. When i browsed the events using kibana, i could see the events are coming. But the event name showing as "Event name + OpCode". That is events OpCode is being attached to the Event…
Binu Vijayan
  • 803
  • 1
  • 9
  • 24
1
vote
1 answer

SLAB stops receiving events from Windows Service

I have a Windows Service (myService) writing ETW events. When I start the service I'm able to see the logs written to file when SLAB Service (slabService) listens to the events. After a few days slabService stops writing events. I don't think SLAB…
Arturo Martinez
  • 3,737
  • 1
  • 22
  • 35
1
vote
2 answers

How can I track the source of exception on trying to set Azure sink for a listener

I'm trying to use Semantic Logging Application Block to store logs into Azure Table Storage. Setup: ObservableEventListener listener1 = new ObservableEventListener(); var conString = …
cassandrad
  • 3,412
  • 26
  • 50
1
2 3