File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
framework/db/src/main/java/com/cloud/utils/db Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -984,6 +984,27 @@ protected List<T> listIncludingRemovedBy(final SearchCriteria<T> sc) {
984984 @ DB ()
985985 @ SuppressWarnings ("unchecked" )
986986 public T findById (final ID id ) {
987+ StackTraceElement [] stack = Thread .currentThread ().getStackTrace ();
988+ String callerClass = "unknown" ;
989+ String callerMethod = "unknown" ;
990+ for (int i = 2 ; i < stack .length ; i ++) {
991+ String className = stack [i ].getClassName ();
992+ String classNameLower = className .toLowerCase ();
993+ String methodName = stack [i ].getMethodName ();
994+ String methodNameLower = methodName .toLowerCase ();
995+ if (!classNameLower .contains ("reflect" ) &&
996+ !classNameLower .contains ("intercept" ) &&
997+ !classNameLower .contains ("proxy" ) &&
998+ !methodNameLower .contains ("reflect" ) &&
999+ !methodNameLower .contains ("intercept" ) &&
1000+ !methodNameLower .contains ("invoke" )){
1001+ callerClass = className ;
1002+ callerMethod = stack [i ].getMethodName ();
1003+ break ;
1004+ }
1005+ }
1006+ logger .info ("@@@findById {}: {} from: {}.{}" ,
1007+ _entityBeanType .getSimpleName (), id , callerClass , callerMethod );
9871008 T result = null ;
9881009 if (_cache != null ) {
9891010 final Element element = _cache .get (id );
You can’t perform that action at this time.
0 commit comments