ApplicationInsights-Java icon indicating copy to clipboard operation
ApplicationInsights-Java copied to clipboard

Disabling instrumentation of logging no longer works

Open dvag-holger-krusemark opened this issue 1 year ago • 1 comments

We disabled instrumentation of logging (log4j2) by export APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL=OFF Disabling worked in version 3.2.4. After upgrading to version 3.3.0, disabling no longer works and the agent transfers all (severity level from 0 to 3) log messages to azure. The agent in version 3.4.1 behaves the same way.

Expected behavior

Log messages are not transmitted to azure, when environment variable APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL is set to "OFF". If the value is set to "FATAL", the agent only transmits log messages with serverity level 4 (FATAL).

Actual behavior

When starting the application, the agent logs the message DEBUG c.m.a.a.i.c.ConfigurationBuilder - read environment variable: APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL=OFF All log messages (log severity from 0 to at least 3) are transmitted to azure. If the value is set to "FATAL", the agent transmits log messages with serverity level 3 (ERROR).

To Reproduce

Sample Application

System information

Please provide the following information:

  • SDK Version: 3.3.0, 3.4.1
  • OS type and version: Linux
  • Application Server type and version (if applicable): Tomcat
  • Using spring-boot? No
  • Additional relevant libraries (with version, if applicable): log4j-2-17.0

Logs

Screenshots

dvag-holger-krusemark avatar Oct 12 '22 11:10 dvag-holger-krusemark

@dvag-holger-krusemark thanks for reporting this! it should be fixed by #2592, and will be included in our next release which we are targeting for mid to end of next week.

trask avatar Oct 13 '22 02:10 trask