Currently
org.springframework.boot.logging.logback.ColorConverter does not support "bright" colors despite AnsiColor does contain codes for all of them. Being a very old class, I have the feeling that the reason is simply nobody updated the available colors, but I might be wrong and there might be a rationale to disallow those
Comment From: wilkinsona
Thanks for the suggestion but we won't be making any enhancements to AnsiColors as it was removed in 3.0.
Comment From: philwebb
Although we removed AnsiColors, we still have AnsiColor and we still support color codes in Logback and Log4J2. I think we could consider an update to the ColorConverter classes if someone wants to contribute them.
Comment From: wilkinsona
Oops. Thanks for catching that, @philwebb.
Comment From: nightswimmings
Maybe it's too unrelated, but IMHO it would not hurt to add
<logger name="org.testcontainers" level="INFO" />
<logger name="com.github.dockerjava" level="WARN"/>
to org/springframework/boot/logging/logback/defaults.xml
being that much of an ubiquitous library nowadays and considering there are other logger defaults :) It's the sole reason why I need to touch logback on every basic setup each time
Comment From: Abhijeetmishr
@philwebb @wilkinsona Can I pick this up ? @wilkinsona How do I find more issues that is up for contribution ?
Regards
Comment From: wilkinsona
@nightswimmings, that's really unrelated to this issue and, unfortunately, I don't think it will work as Testcontainers performs its logging before Spring Boot has a chance to initialise the logging system.
Comment From: wilkinsona
@Abhijeetmishr Thanks, it's all yours.
How do I find more issues that is up for contribution ?
Issues labelled as ideal for contribution are your best bet. We sometimes don't have any though.
Comment From: omlip
Hi, Is there any reason that white and black color are omit from the CodeConverter class ? (either for Log4J and Logback)
private static final Map<String, AnsiElement> ELEMENTS;
static {
Map<String, AnsiElement> ansiElements = new HashMap<>();
ansiElements.put("faint", AnsiStyle.FAINT);
ansiElements.put("red", AnsiColor.RED);
ansiElements.put("green", AnsiColor.GREEN);
ansiElements.put("yellow", AnsiColor.YELLOW);
ansiElements.put("blue", AnsiColor.BLUE);
ansiElements.put("magenta", AnsiColor.MAGENTA);
ansiElements.put("cyan", AnsiColor.CYAN);
ELEMENTS = Collections.unmodifiableMap(ansiElements);
}
Thanks for your answer. Br Olivier
Comment From: krzyk
@Abhijeetmishr @wilkinsona Sorry I didn't know I need to mention that I wanted to work on this.
Either way, you can look at my PR https://github.com/spring-projects/spring-boot/pull/34676
@omlip I also added black and white above.
Comment From: wilkinsona
Thanks, @krzyk, but let's give @Abhijeetmishr a chance to work on this please.
Comment From: nightswimmings
@nightswimmings, that's really unrelated to this issue and, unfortunately, I don't think it will work as Testcontainers performs its logging before Spring Boot has a chance to initialise the logging system.
Thanks Andy. I dont want to extend the conversation once marked as offtopic but I wanted to answer you somehow. I was talking only about defaults.xml, I understand as we spoke in another issue that programmatical spring defaults is another thing, but placing a logback.xml or logback-test.xml by inheriting spring's base.xml (/defaults.xml) would have this out-of-the-box
Please mark this comment as offtopic, and my apologies
Comment From: snicoll
Closing in favor of PR. Thanks @Abhijeetmishr!
Comment From: snicoll
@omlip I don't see any specific reason for them to be omitted but I can see the PR includes them so I am going to expand the scope of it.
Comment From: omlip
@snicoll thanks