build.gradle.kts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. implementation(project(":instrumentation:log4j:log4j-appender-2.16:library"))
  16. testImplementation("org.awaitility:awaitility")
  17. // this is needed for the async logging test
  18. testImplementation("com.lmax:disruptor:3.4.2")
  19. }
  20. tasks {
  21. val testAsync by registering(Test::class) {
  22. jvmArgs("-DLog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector")
  23. }
  24. named<Test>("test") {
  25. dependsOn(testAsync)
  26. }
  27. }
  28. tasks.withType<Test>().configureEach {
  29. // TODO run tests both with and without experimental log attributes
  30. jvmArgs("-Dotel.instrumentation.log4j-appender.experimental.capture-map-message-attributes=true")
  31. jvmArgs("-Dotel.instrumentation.log4j-appender.experimental.capture-context-data-attributes=*")
  32. jvmArgs("-Dotel.instrumentation.log4j-appender.experimental-log-attributes=true")
  33. }