|
From: <jue...@we...> - 2004-01-08 08:13:12
|
Good point: I've changed it to info level: As this is about a rollback =
which isn't the normal flow of operation, info is appropriate, IMO. =
After all, production applications typically just log down to warn level =
anyway (no info, debug, trace).
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Oliver Hutchison
Gesendet: Do 08.01.2004 05:45
An: spr...@li...
Betreff: [Springframework-developer] Inappropriate logging level?
Hi,
Just putting this one out there.
// -------- Start Code --------
private void onThrowable(MethodInvocation invocation,
TransactionAttribute txAtt, TransactionStatus status, Throwable ex) {
if (txAtt.rollbackOn(ex)) {
logger.error("Invoking rollback for transaction on method '" +
invocation.getMethod().getName() +
"' due to throwable [" + ex + "]");
try {
this.transactionManager.rollback(status);
}
catch (TransactionException tex) {
logger.error("Application exception overridden by rollback
exception", ex);
throw tex;
}
}
else {
if (logger.isDebugEnabled())
logger.debug("Method '" + invocation.getMethod().getName()+ "' threw
throwable [" + ex +
"] but this does not force transaction rollback");
// Will still roll back if rollbackOnly is true
this.transactionManager.commit(status);
}
}
// -------- End Code --------
Is it really appropriate for the TransactionInterceptor.onThrowable(...)
method to log the fact that an exception has caused a rollback at level
ERROR?
I would have thought the ERROR level would only be used in places where
a runtime error or unexpected conditions has been detected. What's
happening in the TransactionInterceptor is exactly what should be
happening given its configuration.
IMHO it should really be at DEBUG or TRACE level.
What do you think?
Ollie
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|