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

Removes the deprecated packages Log4j configuration attribute #6326

Merged
merged 1 commit into from
Aug 6, 2024
Merged
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
2 changes: 1 addition & 1 deletion bin/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
~ limitations under the License.
-->

<Configuration status="WARN" packages="org.apache.jmeter.gui.logging">
<Configuration status="WARN">

<Appenders>
<!-- Uncomment to set rotating logs up to 5 files of 100 MB-->
Expand Down
17 changes: 17 additions & 0 deletions src/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.github.autostyle.gradle.AutostyleTask
import com.github.vlsi.gradle.ide.IdeExtension
import java.util.jar.JarFile

plugins {
id("java-test-fixtures")
Expand Down Expand Up @@ -45,6 +46,9 @@ dependencies {
api("org.apache.logging.log4j:log4j-core") {
because("GuiLogEventAppender is using log4j-core to implement GUI-based log appender")
}
kapt("org.apache.logging.log4j:log4j-core") {
ppkarwasz marked this conversation as resolved.
Show resolved Hide resolved
because("Generates a plugin cache file for GuiLogEventAppender")
}
api("org.apache.logging.log4j:log4j-slf4j-impl") {
because("Both log4j and slf4j are included, so it makes sense to just add log4j->slf4j bridge as well")
}
Expand Down Expand Up @@ -188,3 +192,16 @@ tasks.jar {
from("$rootDir/xdocs/images/logo.svg")
}
}

// Checks the generated JAR for a Log4j plugin cache file.
tasks.jar {
doLast {
val jarFile = archiveFile.get().asFile
JarFile(jarFile).use { jar ->
val entryName = "META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat"
if (jar.getJarEntry(entryName) == null) {
throw IllegalStateException("$entryName was not found in $jarFile. The entry should be generated by log4j-core annotation processor")
}
}
}
}
Loading