Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-4449 corrected manner in which BSim sets log4j config

ghidra14348e80f7162
diff --git a/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java b/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java
index 53cbfb9588..7046ce34ca 100644
--- a/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java
+++ b/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java
@@ -44,6 +44,7 @@ import utility.application.ApplicationLayout;
public class BSimLaunchable implements GhidraLaunchable {
+ // BSim log4j config file resides at root of resource directory
private static final String BSIM_LOGGING_CONFIGURATION_FILE = "bsim.log4j.xml";
private static final int DEFAULT_LIST_EXE_LIMIT = 20;
@@ -1056,15 +1057,9 @@ public class BSimLaunchable implements GhidraLaunchable {
*/
System.setProperty(SystemUtilities.HEADLESS_PROPERTY, Boolean.TRUE.toString());
- try {
- URL configFileUrl =
- BSimLaunchable.class.getClassLoader().getResource(BSIM_LOGGING_CONFIGURATION_FILE);
- System.setProperty(LoggingInitialization.LOG4J2_CONFIGURATION_PROPERTY,
- configFileUrl.toURI().toString());
- }
- catch (URISyntaxException e) {
- System.err.println("ERROR: " + e.getMessage());
- }
+ // Use BSim log config to ensure we get desired console output
+ System.setProperty(LoggingInitialization.LOG4J2_CONFIGURATION_PROPERTY,
+ BSIM_LOGGING_CONFIGURATION_FILE);
// Allows handling of old content which did not have a content type property
DomainObjectAdapter.setDefaultContentClass(ProgramDB.class);