I'm trying to figure out how to deal with logging in a CQRS setting. The situation is as follows:
- I have an Rx-based event broker.
- I have a project
Foo.Events
where events inherit fromEventArgs
(not sure why) and correspondingly the broker expects all events to inherit from this class. - I have several subsystems (initialized with DI) post to the logs.
- I need several subsystems to handle logging requests and process them accordingly (show on screen, send xmpp/sms/whatever)
Now, I'm trying to figure out how to fit logging in this. In CQRS, it seems to me that logging isn't an event per se, it is rather the system's response to an event. On the other hand, a log request seems like a command, i.e. the C in CQRS.
I'd love to put this into the event broker somehow, but I'm not sure. Do commands belong on the event broker anyway, can we assume that the broker is just some messaging system that doesn't really care if it's C or Q?
Your help is much appreciated!