Solutions approach

Before we write the code to implement our library (a Windows assembly), let us enumerate the requirements to get the big picture:

  • The data should be written to multiple streams
    • File, network, and DB
  • The developer API should be target-agnostic
  • The library should maintain its object lifetime
  • The library should provide facility for adding new log targets
  • The library should be able to handle concurrent writes to log targets

Get .NET Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.