Skip to content

Commit 51a30a9

Browse files
authored
Update 2.x SDK log4j2 appender to not pull in log4j2 on its own (#2002)
* Update log4j2 appender * Update lockfiles * Need to support Java 7 * Fix unit tests * Fix Jdbc smoke test
1 parent ed95b6d commit 51a30a9

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

logging/log4j2/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ projectPomDescription = "This module provides a $project.msftAppInsights appende
3333
// endregion Publishing properties
3434

3535
dependencies {
36-
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
36+
compileOnly group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
3737
annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
38+
39+
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
3840
}

logging/log4j2/gradle/dependency-locks/runtimeClasspath.lockfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ eu.infomas:annotation-detector:3.0.5
1616
org.apache.commons:commons-lang3:3.7
1717
org.apache.httpcomponents:httpclient:4.5.3
1818
org.apache.httpcomponents:httpcore:4.4.6
19-
org.apache.logging.log4j:log4j-api:2.11.0
20-
org.apache.logging.log4j:log4j-core:2.11.0
2119
org.checkerframework:checker-compat-qual:2.5.2
2220
org.codehaus.mojo:animal-sniffer-annotations:1.17
2321
xmlpull:xmlpull:1.1.3.1

test/smoke/testApps/Jdbc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies {
55
compile aiWebJar
66

77
compile group: 'org.hsqldb', name: 'hsqldb', version: '2.3.6' // 2.4.0+ requires Java 8+
8-
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.43' // the old agent did not support 8.x
8+
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.49' // the old agent did not support 8.x
99
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5.jre7'
1010
compile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '6.4.0.jre7' // 6.5.0+ requires Java 8+
1111

test/smoke/testApps/Jdbc/src/main/java/com/microsoft/applicationinsights/smoketestapp/JdbcTestServlet.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ private static Connection getHsqldbConnection() throws Exception {
263263

264264
private static Connection getMysqlConnection() throws Exception {
265265
String hostname = System.getenv("MYSQL");
266-
return DriverManager.getConnection("jdbc:mysql://" + hostname + "/mysql?autoReconnect=true&useSSL=true&verifyServerCertificate=false", "root", "password");
266+
return DriverManager.getConnection(
267+
"jdbc:mysql://"
268+
+ hostname
269+
+ "/mysql?autoReconnect=true&useSSL=true&enabledTLSProtocols=TLSv1,TLSv1.1,TLSv1.2,TLSv1.3&verifyServerCertificate=false",
270+
"root",
271+
"password");
267272
}
268273

269274
private static Connection getPostgresConnection() throws Exception {

0 commit comments

Comments
 (0)