Skip to content

Seeing all entries as 'trace' log level in Application Insights logs #1273

@jeanabraham

Description

@jeanabraham

Expected behavior

  • All logs levels reflected in Azure Application Insights dashboard as it is in the console/stdout logs. 'INFO' shows up as info itemType.
  • Correct timestamp as it is in the console/stdout logs.

Actual behavior

Azure Application Insights dashboard:
All log levels (INFO, DEBUG, etc) show up as 'trace' in itemType.
image

Console logs

14:11:03.524 [restartedMain] INFO  o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8383"]
14:11:03.524 [restartedMain] INFO  o.a.catalina.core.StandardService - Starting service [Tomcat]
14:11:03.524 [restartedMain] INFO  o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.36]
14:11:03.700 [restartedMain] INFO  o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext

System information

  • SDK Version:
    • JDK@11
    • spring-boot@2.3.1
    • applicationinsights-logging-logback@2.6.1
  • OS type and version: Mac OS X 10.15.5
  • Using spring-boot? Yes

logback-spring.xml

<configuration>
	<appender name="aiAppender"
		class="com.microsoft.applicationinsights.logback.ApplicationInsightsAppender">
		<instrumentationKey>...</instrumentationKey>
	</appender>

	<appender name="stdout"
		class="ch.qos.logback.core.ConsoleAppender">
		<!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder 
			by default -->
		<encoder>
			<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
		</encoder>
	</appender>

	<root level="trace">
		<appender-ref ref="aiAppender" />
		<appender-ref ref="stdout" />
	</root>
</configuration>

Any help appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions