Today, I want to talk a bit about the CustomizableTraceInterceptor included in the Spring framework (FIXME: kompletter Klassenname). Tracing is one of the common examples when it comes to AOP, and the books about Spring usually refer to it in this sense. However, I've got the impression that at least the AOP logging facilities in Spring do not really provide an easy configurable log interceptor, therefore shifting the burden to write their own interceptors over to the application developers.
This is what I'd expect:
* leicht zu konfigurierende Klasse (wie von Spring gewohnt) ... Beispiel
The trace level should be indeed configurable, for obvious reasons. There should be log messages only for calls or exceptions I've configured them for. And it should be possible to limit the tracing of argument lists, for these can get extremly long, filling the monitor of an admin watching the log file with nice patterns.
And this is what I get:
The trace level is stuck to "trace" and there is no possibility to set it to "info" through configuration. Instead, I have to subclass the CustomizableTraceInterceptor and override the *FIXME* method.
* muss die Klasse ableiten und einzelne Teile überschreiben
* überschreiben Loglevel in dieser Klasse (sonst immer trace)
* zusätzlich (!) überschreiben des Loglevels in der Parent Klasse (sonst immer noch trace, selbst wenn in abgeleiteter Klasse überschrieben)
* unsinnige Default-Ausgaben, wenn ich keine Meldung konfiguriere
* keine Möglichkeit, die Länge von Argumentlisten zu beschränken (k.o.-Kriterium)
This is the situation as of Spring 2.5
Of course there have been several discussions about this, e.g. *Link*. I think I'll ask the Spring folks if there is something planned for Spring 3.0 and if not, write mmy own proposal how a really customizable CustomizableTraceInterceptor should look like.
Technorati Tags:
Spring AOP tracing logging