Domain model should be dependency-less. Therefore – it must not contain any reference to logging mechanism. I understand that there are not any problems with logging infrastructure&application layer, but what if i want to log domain model? Is it not supposed to be logged, just unit tested & logged from outside (infrastructure/application)?
Domain model should be dependency-less. Therefore – it must not contain any reference to
Share
Your domain object can have events that notify the outside that things are happening inside.
Your infrastructure can attach to these events to log what’s needed.