abhiramaab commented on code in PR #8343:
URL: https://github.com/apache/hop/pull/8343#discussion_r3999894060


##########
engine/src/test/java/org/apache/hop/core/HopEnvironmentSystemPropertyTest.java:
##########
@@ -94,4 +94,54 @@ void testConfigPropertyAppliedWhenNotSetViaCommandLine() {
         actualValue,
         "Config file property should be applied when not set via 
command-line");
   }
+
+  @Test
+  void testThirdPartyWireLoggingSilencedByDefault() throws Exception {
+    org.apache.logging.log4j.core.LoggerContext context =
+        org.apache.logging.log4j.core.LoggerContext.getContext(false);
+    org.apache.logging.log4j.core.config.Configuration configuration = 
context.getConfiguration();
+    String wireLogger = "org.apache.hc.client5.http.wire";
+
+    try {
+      configuration.removeLogger(wireLogger);
+      context.updateLoggers();
+
+      HopEnvironment.init();
+
+      org.apache.logging.log4j.core.config.LoggerConfig lc =
+          configuration.getLoggerConfig(wireLogger);
+      assertEquals(
+          org.apache.logging.log4j.Level.INFO,
+          lc.getLevel(),

Review Comment:
   - Updated `HopEnvironmentSystemPropertyTest` to assert `lc.getName()` 
matches the wire logger name (preventing false passes from root logger 
fallbacks).        
   - Added assertions for `LogManager.getLogger(wireLogger).isDebugEnabled()` 
(verifying `false` by default and `true` when explicitly configured).
   - Added assertions verifying JUL logger behavior and state restoration in 
`finally` blocks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to