I am also having the same issue as discussed here. If I use the code Travis 
posted :- 

public class Service extends Application<Configuration>

...

     private void initializeLogging( Environment env ) {

          LoggerContext context = (LoggerContext) LoggerFactory.
getILoggerFactory();

          try {

            JoranConfigurator configurator = new JoranConfigurator();

            configurator.setContext( context );

            context.reset();

            String logBackConfigPath = System.getProperty( 
"logback.configurationFile" );

            configurator.doConfigure( logBackConfigPath );

          }

          catch( JoranException je ) {

            throw new ApplicationException( "Unable to initialize logging.", 
je );

}

Then will this make all the loggers unusable which have been created before 
initializeLogging is called.
For example if I have created a logger like below in some other class 
before initializeLogging is called

public class HealthAndMetrics {
   private static final Logger logger = LoggerFactory.getLogger(VneraMetrics
.class);
}

Can context.reset() call be avoided so that it does not resets the logger 
created before initializeLogging is called ?

On Thursday, 3 April 2014 09:12:10 UTC+5:30, Lance N. wrote:
>
> My logback configuration is created at startup, then DropWizard's 
> Application class throws mine away and substitutes its own. Both Logback 
> and Application run these inits out of static blocks. I guess my program's 
> starting order for static blocks is different than most people's? 
>
> Is there some standard workaround for this?
>
> Cheers,
>
> Lance
>

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to