I currently have two interceptors that handle a similar function. I'd like to merge these.
One interceptor is an access request logger, that shows the logged in user, the session id, and the requested URL.
The other interceptor is a process time logger.
The access logger, in order to log all that must be logged, logs the request in the preHandle method. The idea is that regardless of what happens after (ie. exceptions), the exact access request will be there.
The process time logger however, due to its nature, must log in the postHandle method.
For merging this functionality, I'd have to move everything into a single postHandle method. However, it seems I may lose some logging if an exception occurs somewhere, especially one that is not (yet) handled properly in the application code.
Is there any guarantee or description as to these considerations?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…