public static Class < ? > getLoggingClass ( Object object ) { Class < ? > result = object . getClass ( ) ; if ( result . getSimpleName ( ) . matches ( ".*[$].*CGLIB.*" ) ) { result = result . getSuperclass ( ) ; } return result ; }
Returns the class that can be used to derive the logger name from . For CGLIB advised classes this is the super class of the object class .