final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
final ResourceRoot root = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
// If this is a subdeployment and a log configuration was found on the parent, use that log context
if (SubDeploymentMarker.isSubDeployment(root)) {
final LogContext logContext = findParentLogContext(deploymentUnit);
if (logContext != null) {
LoggingExtension.CONTEXT_SELECTOR.registerLogContext(module.getClassLoader(), logContext);
return;
}
}
LoggingLogger.ROOT_LOGGER.trace("Scanning for logging configuration files.");
final VirtualFile configFile = findConfigFile(root);
if (configFile != null) {
InputStream configStream = null;
try {
LoggingLogger.ROOT_LOGGER.debugf("Found logging configuration file: %s", configFile);
// Create the log context and load into the selector for the module.
final LogContext logContext = LogContext.create();
LoggingExtension.CONTEXT_SELECTOR.registerLogContext(module.getClassLoader(), logContext);
deploymentUnit.putAttachment(LOG_CONTEXT_KEY, logContext);
// Get the filname and open the stream
final String fileName = configFile.getName();