Commands and logging into mongo


I’ve decided to use the command pattern. I know that so far the domain part is small and therefore it is rushing things a bit. But I want to have small, but working application.
My idea was to log every command execution, with its content. Then it will be easy to find out who and in what way messed with our app. I’m using tactician. With it it is really easy to plug in logging middleware…

… and inject into it my Mongo Logger:

I’m logging into documentary database because why not? It looks like a good idea – commands have different fields types, different fields count. And to be honest I also wanted to play a bit with the mongodb. And If later I will come to a conclusion that Mongo was a bad idea – it is just one small class to change.

Leave a Reply

Your email address will not be published. Required fields are marked *