Pergunta

I'm currently developing a small C# desktop app using MongoDB as my database of choice, using a classic three-tiered architecture (presentation, business logic and data access). Recently, I got into the entire debacle of logging with a friend of mine, and we started discussing where should application logging take place (for app messages/codes, minor errors, fatal exceptions and everything else). Personally, I believe doing exception handling and error logging in the presentation tier would be optimal, but that's just me.

Are there any industry standards or anything of the sort about where should logging take place? If not, what advantages and what disadvantages do I get for logging in either tier?

Foi útil?

Solução

I agree with you that if you have a traditional 3-tier desktop, then error handling and logging in the presentation layer makes the most sense. Where it gets to be a debate is if you are going to have a non-presentation layer interfacing with your other layers (business and data-access); like a web service for instance. Having a logging and error handling layer is the approach I see most often used in those scenarios.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top