Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LNK-3334: Error occurred while evaluating measure: Cannot invoke "java.net.URL.openConnection()" because "url" is null #607

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
Expand All @@ -33,13 +34,23 @@ public class FileSystemInvocation {
private static final FhirContext fhirContext = FhirContext.forR4Cached();
private static final Logger logger = LoggerFactory.getLogger(FileSystemInvocation.class);

private static void configureLogging(Bundle bundle) throws JoranException {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
context.reset();
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(context);
configurator.doConfigure(ClassLoader.getSystemResource("logback-cli.xml"));
CqlLogAppender.start(context, libraryId -> CqlUtils.getLibrary(bundle, libraryId));
private static void configureLogging(Bundle bundle) {
try {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
context.reset();
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(context);
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
URL resource = classLoader.getResource("logback-cli.xml");
if (resource == null) {
logger.warn("logback-cli.xml not found in classpath");
return;
}
configurator.doConfigure(resource);
CqlLogAppender.start(context, libraryId -> CqlUtils.getLibrary(bundle, libraryId));
} catch (Exception e) {
logger.warn("Failed to configure logging", e);
}
}

private static Bundle getBundle(String measureBundlePath) throws IOException {
Expand Down
Loading