Default for using logs

2

I have a project organized as follows:

1. Web (ASP.NET MVC)
2. Application
3. Domain
4. Infra.Data
5. Infra.Log (NLog)
6. Infra.IoC

The project references are as follows:

- Web --> Application
- Web --> Domain
- Application --> Domain
- Infra.Data --> Domain
- Infra.Log --> Application
- Web --> Infra.IoC

I created a log interface in the Application layer and its implementation in the Layer Infra.Log. And, by injection of dependency, I use it in the Web and Application layer. But you can not use the service on the other layers due to the reference between the projects.

I do not want to "dirty" projects with unnecessary references, because the DDD recommends a certain order in the references. For example, the Infra.Data layer can not reference the Application. But I want all layers to have access to the logging service.

  • Is there a standard to resolve this?
  • And how to do with the Domain layer that can not reference no one?
asked by anonymous 04.11.2016 / 21:28

0 answers