public synchronized void reconfigure ( Properties props ) { // First isolate any property that is different from the immutable // set of original initialization properties Properties newOverrideProps = new Properties ( ) ; for ( Entry < Object , Object > prop : props . entrySet ( ) ) { if ( isLog4JProperty ( prop . getKey ( ) . toString ( ) ) ) { Object initialValue = initialProps . get ( prop . getKey ( ) ) ; if ( initialValue == null || ! initialValue . equals ( prop . getValue ( ) ) ) { newOverrideProps . put ( prop . getKey ( ) , prop . getValue ( ) ) ; } } } // Compare against our cached set of override if ( ! overrideProps . equals ( newOverrideProps ) ) { this . overrideProps . clear ( ) ; this . overrideProps . putAll ( newOverrideProps ) ; reConfigureAsynchronously ( ) ; } }
Set a snapshot of all LOG4J properties and reconfigure if properties have been changed .