Partager via


Key Scenarios

This series of topics describes common situations developers must address when providing logging functionality in their applications. Each scenario explains the task, describes a real-world situation where such a task might arise, and includes code demonstrating how to use the Logging Application Block to complete the task. The scenarios are as follows:

  • Logging to a Database. This topic describes the process you should follow for using the Logging Application Block to implement the common requirement of logging to a database.
  • Logging to Windows Event Log. This topic describes the process you should follow for using the Logging Application Block to implement the common requirement of logging to Windows Event Log.
  • Logging to a Disk File. This topic describes the process you should follow for using the Logging Application Block to implement the common requirement of logging to a disk file.
  • Logging to Windows Message Queuing. This topic describes the process you should follow for using the Logging Application Block to implement the common requirement of logging to Windows Message Queuing.
  • Logging to WMI. This topic describes the process you should follow for using the Logging Application Block to implement the common requirement of logging to the Windows Management Instrumentation repository.
  • Logging as E-mail Messages. This topic describes the process you should follow for using the Logging Application Block to implement the common requirement of sending logging information in e-mail messages.
  • Populating and Raising Events from Code. This scenario illustrates how to write code to specify the data to be logged, along with a category and priority, and pass it to the application block.
  • Populating a Log Message with Additional Context Information. This scenario illustrates how to populate a dictionary of custom information to be added to a log entry.
  • Tracing Activities and Propagating Context Information. This scenario illustrates how to log the start and end of an activity and trace key activity points in between.
  • Checking Filter Status before Constructing Log Messages. This scenario illustrates how to avoid collecting log information for messages that will not be logged according to the current configuration information.