2013-12-18

Given the following situation:

Infrastructure interface IEventAppender provides the method void AppendEvents(IEnumerable<Event> events). There is a concrete implementation NEventStoreEventAppender which saves the events into an NEventStore (if you don't know NEventStore, think of it as a database).

Among other users, our import tool also uses the IEventAppender interface. However, there is a special requirement: log a message for each imported batch which contains (timestamp, source, eventStoreCommitId).

Timestamp and source information is only available in the import tool (keep in mind: source is not static information, it may be different for each event!). The eventStoreCommitId on the other hand is currently only available in the NEventStoreEventAppender class.

Question:

Where/How to create the log entry? I currently do not have any point where all the information is known.

Also, I do not want to change the IEventAppender interface. Other users do not want to create such log entries and do not even have a "source". Therefore it does not make sense to provide a method AppendEvents(IEnumerable<ExtendedEvent> events) where ExtendedEvent combines the Event with the source information.

Show more