Skip to content

When using HighlightingCompositeConverter or custom one we get LOGBACK: No context given for ch.qos.logback.core.spi.ContextAwareBase #27729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
greedyaj opened this issue Aug 17, 2021 · 1 comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@greedyaj
Copy link

greedyaj commented Aug 17, 2021

Please use attached
logback-spring.xml.txt
sample logback-spring.xml to reproduce the issue.
This issue is when we use 'highlight' conversion rule, same is the case with the custom conversion rule as well.

[spring-boot version 2.5.2]

@wilkinsona
Copy link
Member

Thanks for the report, but this does not have anything to do with Spring Boot.

The same output is produced with the following:

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.example</groupId>
	<artifactId>gh-27729</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<dependencies>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.2.4</version>
		</dependency>
	</dependencies>
</project>

logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%highlight(%date{DEFAULT} | [%-15thread] | %-5level | [%X{project_id}] | %-60class - %msg) %replace(%xThrowable){'\n',' '}%nopex%n</pattern>
        </encoder>
    </appender>
    <logger name="org.springframework" level="OFF" additivity="false"/>
    <root level="WARN">
        <appender-ref ref="CONSOLE"/>
    </root>
</configuration>

Main class:

package com.example.demo;

import org.slf4j.LoggerFactory;

public class Gh27729Application {

	public static void main(String[] args) {
		LoggerFactory.getLogger(Gh27729Application.class).info("Test");
	}

}

@wilkinsona wilkinsona added for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants