protected static boolean createLoggingAction ( final Logger logger , final Logger auditor , final TransactionLogger instance ) { TransactionLogger oldInstance = getInstance ( ) ; if ( oldInstance == null || oldInstance . finished ) { if ( loggingKeys == null ) { synchronized ( TransactionLogger . class ) { if ( loggingKeys == null ) { logger . info ( "Initializing 'LoggingKeysHandler' class" ) ; loggingKeys = new LoggingKeysHandler ( keysPropStream ) ; } } } initInstance ( instance , logger , auditor ) ; setInstance ( instance ) ; return true ; } return false ; // Really not sure it can happen - since we arrive here in a new thread of transaction I think it's ThreadLocal should be empty. But leaving this code just in case... }
Create new logging action This method check if there is an old instance for this thread - local If not - Initialize new instance and set it as this thread - local s instance