build.gradle.kts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("org.apache.logging.log4j")
  7. module.set("log4j-core")
  8. versions.set("[2.11.0,)")
  9. assertInverse.set(true)
  10. }
  11. }
  12. dependencies {
  13. library("org.apache.logging.log4j:log4j-core:2.16.0")
  14. compileOnly(project(":instrumentation-appender-api-internal"))
  15. compileOnly(project(":javaagent-bootstrap"))
  16. implementation(project(":instrumentation:log4j:log4j-appender-2.16:library"))
  17. testImplementation("org.awaitility:awaitility")
  18. // this is needed for the async logging test
  19. testImplementation("com.lmax:disruptor:3.4.2")
  20. }
  21. tasks {
  22. val testAsync by registering(Test::class) {
  23. jvmArgs("-DLog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector")
  24. }
  25. named<Test>("test") {
  26. dependsOn(testAsync)
  27. }
  28. }
  29. tasks.withType<Test>().configureEach {
  30. // TODO run tests both with and without experimental log attributes
  31. jvmArgs("-Dotel.instrumentation.log4j-appender.experimental.capture-map-message-attributes=true")
  32. jvmArgs("-Dotel.instrumentation.log4j-appender.experimental.capture-context-data-attributes=*")
  33. jvmArgs("-Dotel.instrumentation.log4j-appender.experimental-log-attributes=true")
  34. }