protected static void setLogbackExternal ( final String fileName ) { try { final ObjectName logbackObjectName = new ObjectName ( "ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator" ) ; ManagementFactory . getPlatformMBeanServer ( ) . invoke ( logbackObjectName , "reloadByFileName" , new Object [ ] { fileName } , new String [ ] { String . class . getName ( ) } ) ; log . info ( "Set external logback config to [{}]" , fileName ) ; } catch ( Exception ex ) { log . warn ( "Failed to set external logback config to [{}]" , fileName , ex ) ; } }
Reloads the logback configuration to an external file