Partager via


Key scenarios for the Semantic Logging Application Block

patterns & practices Developer Center

This section describes the key scenarios for using the Semantic Logging Application Block to collect, store, and correlate events. It includes the following scenarios:

  • Logging events to the Console. Logging event information to a console window is a useful technique while you develop and test your logging strategy. It allows you to quickly and easily see the information that is collected, and ensure that your event sources, sinks, and formatters are producing the results you require.
  • Logging events to a disk file. A common requirement for logging is to store the information in a disk file. There is a range of options for formatting the information, such as using JSON or XML formats, and for managing rollover of the disk files.
  • Logging events to a database. You can use the Semantic Logging Application Block to implement the common requirement of logging to a SQL Server database. You must perform some prerequisite steps to set up the target database, and ensure that you protect the data and the database connection details.
  • Logging events to Azure table storage. You can store event logs in Microsoft Azure table storage. This approach provides a cost-effective solution for storing event logs in the cloud.
  • Correlating events. You can collect events from asynchronous processes. When collecting events from processes that use the Parallel Task Library (TPL) you can use associated event identifiers to trace the events for different asynchronous tasks that are part of the overall process.
  • Sampling and filtering events. You can specify arguments that are passed to an event source when you create a listener. A typical use of this feature is to reduce the number of events received from event sources outside of your application by collecting only a representative sample instead of receiving all of them.

Next Topic | Previous Topic | Home | Community