I want to know what is difference between Logging Application Block and Semantic Application block. When to use one over other. What are cons and pro's of each.
Thank you
The Semantic Logging Application Block is a framework for capturing and manipulating events raised by applications, and storing the typed and structured information they contain in log files or other logging stores. It takes advantage of features of the .NET Framework (version 4.5 and above) and Event Tracing for Windows (ETW). ETW is a fast, lightweight, strongly typed, extensible logging system that is built into the Windows operating system.
The Semantic Logging Application Block captures events generated by custom event source classes that extend the EventSource class. You create these classes to define the events your application can raise for logging. You then define the event sinks that specify the target destination(s) for events, such as a database or a text file, and—where appropriate—attach a log formatter to these sinks. This gives you full control over the routing and format of the logged information.
link - https://msdn.microsoft.com/en-us/library/dn775014(v=pandp.20).aspx
The Logging Application Block allows you to decouple your logging functionality from your application code. The block can route log entries to a Windows Event Log, a database, or a text (or XML) file. It can also generate an email message containing the logging information, a message you can route through Windows Message Queuing (using a distributor service provided with the block). And, if none of these built-in capabilities meets your requirements, you can create a provider that sends the log entry to any other custom location or executes some other action.
link - https://msdn.microsoft.com/en-us/library/dn440731(v=pandp.60).aspx
If you are concerned about the potential overhead of logging on the performance of your application, or you want to use more structured log messages, or you plan to automate processes from log entries, you should consider using the Semantic Logging Application Block instead of the Logging Application Block.
The Semantic Logging Application Block provides a number of listeners that can be used to consumer EventSource events and persist them to various locations, including Windows Azure Tables.
The Logging Application Block provides a consistent interface for logging information to any destination. Your application code does not specify the destination for the information. Configuration settings determine whether the application block writes the logging information and the location for that information. This means that operators as well as developers can modify logging behavior without changing application code.
for more details I think below links might help you. Something is better than Nothing :)
SLAB :- https://convective.wordpress.com/2013/08/12/semantic-logging-application-block-slab/
LAB :- https://msdn.microsoft.com/en-us/library/cc309257.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With