When you add a repository to pipeline it logs every command/query that passes thru. However, sometimes a client may run a command within command. It may increase messages log and makes it hard to use as event sourcing. Add option to the repository to do not log nested messages.
Example: AddUserCommand runs UpdateStatistic. In the current implementation in messages log you would see two messages in a log. Expected to have only AddUserCommand one.
When you add a repository to pipeline it logs every command/query that passes thru. However, sometimes a client may run a command within command. It may increase messages log and makes it hard to use as event sourcing. Add option to the repository to do not log nested messages.
Example:
AddUserCommand
runsUpdateStatistic
. In the current implementation in messages log you would see two messages in a log. Expected to have onlyAddUserCommand
one.Proposal: Add a new property
AddNestedMessages
(true by default) toRepositoryMiddleware
. You can use this code for scope: https://github.com/Saritasa/SaritasaTools/blob/3d29320ee678a92d4c6f0195d3fddf6522133589/src/Saritasa.Tools.NLog4/LoggerScope.cs