private String conventionalConfigFileName(String contextName) {
return "logback-" + contextName + ".xml";
}
private URL findConfigFileURL(Context ctx, LoggerContext loggerContext) {
StatusManager sm = loggerContext.getStatusManager();
String jndiEntryForConfigResource = JNDIUtil.lookup(ctx,
JNDI_CONFIGURATION_RESOURCE);
// Do we have a dedicated configuration file?
if (jndiEntryForConfigResource != null) {
sm.add(new InfoStatus("Searching for [" + jndiEntryForConfigResource
+ "]", this));
URL url = urlByResourceName(sm, jndiEntryForConfigResource);
if (url == null) {
String msg = "The jndi resource [" + jndiEntryForConfigResource
+ "] for context [" + loggerContext.getName()
+ "] does not lead to a valid file";
sm.add(new WarnStatus(msg, this));
}
return url;
} else {
String resourceByConvention = conventionalConfigFileName(loggerContext
.getName());