Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 5 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ junit = { module = "junit:junit", version = "4.13.1" }
junit-platform-console-standalone = { module = "org.junit.platform:junit-platform-console-standalone", version = "1.11.4" }
libphonenumber = { module = "com.googlecode.libphonenumber:libphonenumber", version = "8.12.50" }
listenablefuture = { module = "com.google.guava:listenablefuture", version = "9999.0-empty-to-avoid-conflict-with-guava" }
log4j-1-2-api = { module = "org.apache.logging.log4j:log4j-1.2-api", version.ref = "log4j" }
log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" }
log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" }
log4j-slf4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version.ref = "log4j" }
miglayout-core = { module = "com.miglayout:miglayout-core", version.ref = "miglayout" }
miglayout-swing = { module = "com.miglayout:miglayout-swing", version.ref = "miglayout" }
mimepull = { module = "org.jvnet.mimepull:mimepull", version = "1.9.7" }
Expand Down Expand Up @@ -241,7 +241,6 @@ reflections = { module = "org.reflections:reflections", version = "0.9.10" }
rhino = { module = "org.mozilla:rhino", version = "1.7.13" }
saaj-impl = { module = "com.sun.xml.messaging.saaj:saaj-impl", version = "1.4.0" }
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-log4j12 = { module = "org.slf4j:slf4j-log4j12", version.ref = "slf4j" }
snakeyaml = { module = "org.yaml:snakeyaml", version = "2.5" }
stax-ex = { module = "org.jvnet.staxex:stax-ex", version = "1.8" }
staxon = { module = "de.odysseus.staxon:staxon", version = "1.3" }
Expand Down Expand Up @@ -314,17 +313,16 @@ client-main = [
"jetty-util",
"joda-time",
"libphonenumber",
"log4j-1-2-api",
"log4j-api",
"log4j-core",
"log4j-slf4j-impl",
"miglayout-core",
"miglayout-swing",
"mimepull",
"quartz",
"reflections",
"rhino",
"slf4j-api",
"slf4j-log4j12",
"staxon",
"swagger-annotations",
"swingx-core",
Expand Down Expand Up @@ -374,11 +372,11 @@ command-main = [
"jetty-util",
"log4j-api",
"log4j-core",
"log4j-slf4j-impl",
"mimepull",
"reflections",
"rhino",
"slf4j-api",
"slf4j-log4j12",
"staxon",
"swagger-annotations",
"velocity-engine-core",
Expand Down Expand Up @@ -413,16 +411,15 @@ donkey-main = [
"javassist",
"jsr305",
"listenablefuture",
"log4j-1-2-api",
"log4j-api",
"log4j-core",
"log4j-slf4j-impl",
"mssql-jdbc",
"mysql-connector-j",
"ojdbc8",
"postgresql",
"quartz",
"slf4j-api",
"slf4j-log4j12",
"xpp3",
"xstream",
]
Expand All @@ -440,11 +437,10 @@ generator-main = [
"commons-collections4",
"commons-io",
"commons-lang3",
"log4j-1-2-api",
"log4j-api",
"log4j-core",
"log4j-slf4j-impl",
"slf4j-api",
"slf4j-log4j12",
"velocity-engine-core",
]
server-extensions = [
Expand Down Expand Up @@ -595,7 +591,6 @@ server-main = [
"joda-time",
"jsch",
"jsr181-api",
"log4j-1-2-api",
"log4j-api",
"log4j-core",
"mimepull",
Expand Down
14 changes: 5 additions & 9 deletions gradle/vendored-layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"org.apache.httpcomponents:httpclient": "",
"org.apache.httpcomponents:httpcore": "",
"org.apache.httpcomponents:httpmime": "",
"org.apache.logging.log4j:log4j-1.2-api": "",
"org.apache.logging.log4j:log4j-api": "",
"org.apache.logging.log4j:log4j-core": "",
"org.apache.logging.log4j:log4j-slf4j-impl": "",
"org.apache.velocity.tools:velocity-tools-generic": "",
"org.apache.velocity:velocity-engine-core": "",
"org.bouncycastle:bcpkix-jdk18on": "",
Expand All @@ -61,7 +61,6 @@
"org.quartz-scheduler:quartz": "",
"org.reflections:reflections": "",
"org.slf4j:slf4j-api": "",
"org.slf4j:slf4j-log4j12": "",
"org.swinglabs:swingx-core": {
"dir": "",
"file": "swingx-core-1.6.2.jar"
Expand Down Expand Up @@ -99,6 +98,7 @@
"org.apache.httpcomponents:httpmime": "",
"org.apache.logging.log4j:log4j-api": "",
"org.apache.logging.log4j:log4j-core": "",
"org.apache.logging.log4j:log4j-slf4j-impl": "",
"org.apache.velocity.tools:velocity-tools-generic": "",
"org.apache.velocity:velocity-engine-core": "",
"org.bouncycastle:bcpkix-jdk18on": "",
Expand All @@ -120,7 +120,6 @@
"org.mozilla:rhino": "",
"org.reflections:reflections": "",
"org.slf4j:slf4j-api": "",
"org.slf4j:slf4j-log4j12": "",
"xpp3:xpp3": ""
},
"donkey": {
Expand Down Expand Up @@ -148,27 +147,25 @@
"org.apache.commons:commons-pool2": "commons",
"org.apache.commons:commons-text": "commons",
"org.apache.derby:derby": "database",
"org.apache.logging.log4j:log4j-1.2-api": "",
"org.apache.logging.log4j:log4j-api": "",
"org.apache.logging.log4j:log4j-core": "",
"org.apache.logging.log4j:log4j-slf4j-impl": "",
"org.checkerframework:checker-qual": "guava",
"org.javassist:javassist": "",
"org.postgresql:postgresql": "database",
"org.quartz-scheduler:quartz": "",
"org.slf4j:slf4j-api": "",
"org.slf4j:slf4j-log4j12": "",
"xpp3:xpp3": "xstream"
},
"generator": {
"commons-io:commons-io": "",
"org.apache.commons:commons-collections4": "",
"org.apache.commons:commons-lang3": "",
"org.apache.logging.log4j:log4j-1.2-api": "",
"org.apache.logging.log4j:log4j-api": "",
"org.apache.logging.log4j:log4j-core": "",
"org.apache.logging.log4j:log4j-slf4j-impl": "",
"org.apache.velocity:velocity-engine-core": "",
"org.slf4j:slf4j-api": "",
"org.slf4j:slf4j-log4j12": ""
"org.slf4j:slf4j-api": ""
},
"server": {
"ca.uhn.hapi:hapi-structures-v27": "hapi",
Expand Down Expand Up @@ -267,7 +264,6 @@
"org.apache.httpcomponents:httpclient": "commons",
"org.apache.httpcomponents:httpcore": "commons",
"org.apache.httpcomponents:httpmime": "commons",
"org.apache.logging.log4j:log4j-1.2-api": "log4j",
"org.apache.logging.log4j:log4j-api": "log4j",
"org.apache.logging.log4j:log4j-core": "log4j",
"org.apache.taglibs:taglibs-standard-impl": {
Expand Down
24 changes: 8 additions & 16 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1828,14 +1828,6 @@
<sha256 value="ea4705725fd94bf5debe2911d4ea7af20898603f68354e64b2461a0f249e445d" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.logging.log4j" name="log4j-1.2-api" version="2.26.1">
<artifact name="log4j-1.2-api-2.26.1.jar">
<sha256 value="6f063c9c533788cb548d88ddb4bc7c59fbdb830182fc23d19e8d16ed0d8e2986" origin="Generated by Gradle"/>
</artifact>
<artifact name="log4j-1.2-api-2.26.1.module">
<sha256 value="44eb8df5d4e9feeaf714fa81f38776d68646b867c75e2cf4219a27ef0c0ec50c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.logging.log4j" name="log4j-api" version="2.26.1">
<artifact name="log4j-api-2.26.1.jar">
<sha256 value="f1810a4704ccce019d02bba029dc02a4f2ac0c997f647b465e7d409c1927f822" origin="Generated by Gradle"/>
Expand All @@ -1862,6 +1854,14 @@
<sha256 value="03bfd8adbe306ac46001ec9de668f8e5d24f6659f212fc64e62a1b672a5a2f6a" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.logging.log4j" name="log4j-slf4j-impl" version="2.26.1">
<artifact name="log4j-slf4j-impl-2.26.1.jar">
<sha256 value="1afc7b00db35d6bdc309b35cee01dd114b292c2d903975f2987da870b24cea6e" origin="Generated by Gradle"/>
</artifact>
<artifact name="log4j-slf4j-impl-2.26.1.module">
<sha256 value="78ef1bbe5eee705e44249dad9e116b01346973098144c91dc588bc70c102ca14" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apache.lucene" name="lucene-analysis-common" version="9.12.3">
<artifact name="lucene-analysis-common-9.12.3.jar">
<sha256 value="fa571bd7caf0f0b4faf46a72ca004a7836f348c31d92bd522dddcc3d128d287e" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -3046,14 +3046,6 @@
<sha256 value="f78d27b642b4b886eb839fc102b5cd9fe7f30f37599ffe68185be4e1609031e9" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.slf4j" name="slf4j-log4j12" version="1.7.30">
<artifact name="slf4j-log4j12-1.7.30.jar">
<sha256 value="4d41e01c40caf8a6c74add2b073055d8a4ce1c30e58154177b13f12d78abbe7b" origin="Generated by Gradle"/>
</artifact>
<artifact name="slf4j-log4j12-1.7.30.pom">
<sha256 value="47afeff58a7e4c64595effd7d122dc7c497f298be8d5b0f5cbf1910f7150c70a" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.slf4j" name="slf4j-parent" version="1.7.30">
<artifact name="slf4j-parent-1.7.30.pom">
<sha256 value="11647956e48a0c5bfb3ac33f6da7e83f341002b6857efd335a505b687be34b75" origin="Generated by Gradle"/>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ protected static void appendTransformerScript(StringBuilder builder, Transformer
builder.append("function doTransform() {");

if (!response) {
builder.append(" phase[0] = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase[0]);");
builder.append(" phase[0] = 'transformer'; logger = Packages.org.apache.logging.log4j.LogManager.getLogger(phase[0]);");
}

builder.append("\n\n\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

import org.apache.ibatis.exceptions.PersistenceException;
import org.apache.ibatis.session.SqlSessionManager;
import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.mirth.connect.client.core.ControllerException;
import com.mirth.connect.model.DebugUsage;
Expand All @@ -30,7 +31,7 @@
public class DefaultDebugUsageController extends DebugUsageController {

private static final String VACUUM_LOCK_ID = "DebugUsage.vacuumDebuggerUsageTable";
private Logger logger = Logger.getLogger(this.getClass());
private Logger logger = LogManager.getLogger(this.getClass());
private ConfigurationController configurationController = ControllerFactory.getFactory().createConfigurationController();
// singleton pattern
private static DebugUsageController instance = null;
Expand All @@ -50,7 +51,7 @@ public static DebugUsageController create() {
try {
instance.getClass().getMethod("initialize").invoke(instance);
} catch (Exception e) {
Logger.getLogger(DefaultDebugUsageController.class).error("Error calling initialize method in DefaultConfigurationController", e);
LogManager.getLogger(DefaultDebugUsageController.class).error("Error calling initialize method in DefaultConfigurationController", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public ExtensionStatusProvider(Properties mirthProperties) {
this.mirthProperties = mirthProperties;

try {
logger = new LoggerWrapper(Thread.currentThread().getContextClassLoader().loadClass("org.apache.log4j.Logger").getMethod("getLogger", Class.class).invoke(null, ExtensionStatuses.class));
logger = new LoggerWrapper(Thread.currentThread().getContextClassLoader().loadClass("org.apache.logging.log4j.LogManager").getMethod("getLogger", Class.class).invoke(null, ExtensionStatuses.class));
} catch (Throwable t) {
logger = new LoggerWrapper(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static ExtensionStatuses getInstance() {

private ExtensionStatuses() {
try {
logger = new LoggerWrapper(Thread.currentThread().getContextClassLoader().loadClass("org.apache.log4j.Logger").getMethod("getLogger", Class.class).invoke(null, ExtensionStatuses.class));
logger = new LoggerWrapper(Thread.currentThread().getContextClassLoader().loadClass("org.apache.logging.log4j.LogManager").getMethod("getLogger", Class.class).invoke(null, ExtensionStatuses.class));
} catch (Throwable t) {
logger = new LoggerWrapper(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/** Utility class for bootstrapping Log4j. */
final class Log4jBootstrap {
private static final File LOG4J_LIB_DIR = new File("./server-lib/log4j");
private static final String[] JAR_PATTERNS = { "log4j-core-*.jar", "log4j-api-*.jar", "log4j-1.2-api-*.jar" };
private static final String[] JAR_PATTERNS = { "log4j-core-*.jar", "log4j-api-*.jar" };

private Log4jBootstrap() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public boolean isWritePoolCache() {
*/
private void init() {
try {
LogFactory.useLog4JLogging();
LogFactory.useCommonsLogging();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this only needed because the MyBatis upgrade hasn't merged yet?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. MyBatis 3.1.1 has no log4j2 adapter (it arrived in 3.2), and its log4j adapter needs the log4j 1.x classes this PR removes, so commons-logging is the only route to log4j2 for now. Once #545 (MyBatis 3.5.19) lands, this can become LogFactory.useLog4J2Logging(); whichever PR merges second will make that switch.

🤖 Addressed by Claude Code

System.setProperty("derby.stream.error.method", "com.mirth.connect.server.Mirth.getNullOutputStream");

DatabaseSettings databaseSettings = ControllerFactory.getFactory().createConfigurationController().getDatabaseSettings();
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void testGetClasspathUrlsDoesNotDependOnVersions() throws Exception {
File log4jLibDir = Files.createTempDirectory("log4j").toFile();
log4jLibDir.deleteOnExit();

for (String name : Arrays.asList("log4j-core-99.0.0.jar", "log4j-api-99.0.0.jar", "log4j-1.2-api-99.0.0.jar")) {
for (String name : Arrays.asList("log4j-core-99.0.0.jar", "log4j-api-99.0.0.jar")) {
File jarFile = new File(log4jLibDir, name);
assertTrue(jarFile.createNewFile());
jarFile.deleteOnExit();
Expand All @@ -33,7 +33,6 @@ public void testGetClasspathUrlsDoesNotDependOnVersions() throws Exception {

assertEquals(Arrays.asList(
new File(log4jLibDir, "log4j-core-99.0.0.jar").toURI().toURL(),
new File(log4jLibDir, "log4j-api-99.0.0.jar").toURI().toURL(),
new File(log4jLibDir, "log4j-1.2-api-99.0.0.jar").toURI().toURL()), classpathUrls);
new File(log4jLibDir, "log4j-api-99.0.0.jar").toURI().toURL()), classpathUrls);
}
}
Loading