public static void addToRootLogger ( Registry registry , String name , boolean ignoreExceptions ) { final Appender appender = new SpectatorAppender ( registry , name , null , null , ignoreExceptions ) ; appender . start ( ) ; LoggerContext context = ( LoggerContext ) LogManager . getContext ( false ) ; Configuration config = context . getConfiguration ( ) ; addToRootLogger ( appender ) ; config . addListener ( reconfigurable -> addToRootLogger ( appender ) ) ; }
Add the spectator appender to the root logger . This method is intended to be called once as part of the applications initialization process .