[logback-user] Including external groovy code in logback.groovy

Steve Drach drach at itsit.org
Sun Mar 4 18:39:29 CET 2012


Is there an idiom for doing this?  I came up with this technique:

Logger rootLogger = (Logger)LoggerFactory.getLogger("root");
LoggerContext loggerContext = rootLogger.getLoggerContext();
GafferUtil.runGafferConfigurationOn(loggerContext, this, urlToConfigfile);

Good?  Bad?  Is the a better way?

Also can I do something like this:

1. create some initial configuration code, including some default appenders

2. import configuration code from a URL as above

3. append some more groovy code


More information about the Logback-user mailing list