Alan D. Cabrera a écrit :
IMO, we should log :
- where we got the exception if we know that no log has already been
generated
I'm against this since you usually have no idea if someone else has
logged the error.
When you are writing a framework, you are the one responsible for
logging, nobody else will do that for you. This is why I think it's
important to log as close as possible to the place the error was produced.
- In some case, it might be interesting to use a specific logger. For
instance, if you grab a new connection to a LDAP serve,r and get an
exception, using a dedicated logger can help when analysing
specifically all the LDAP related issues.
Interesting idea but my experience has been that you need a "larger"
context to make sense of things. I think that if we did have a
dedicated logger then we would log to both w/ the chattier logging
going to the dedicated logger.
Not necessarily. I have written such system where dedicated logs were
produced (mainly JDBC or LDAP or whatever technical system) but not
duplicated in the mail logs, or with less detailed errors.
Anyway, most of the case you'll will be able to know when you added too
many logs by running the code you have added some logs to.