Похожие чаты

How can I get the default Spring Boot Log pattern

even when I define new custom appenders through log4j2 using YML file?

7 ответов

32 просмотра

Why do you need the default when you can specify your own pattern?

Roy- Автор вопроса

For logback there's handy option for this: logback-spring.xml <configuration> <include resource="org/springframework/boot/logging/logback/base.xml"/> <-- your custom specific config --!> </configuration> But I discovered it only recently, and at the moment I work with logback only. Previously for logback and log4j2 what I always did, was simply: - in IDE do lookup over the whole classpath for file "log4j2.*", find the one that comes in spring boot jar - copy the pattern from there ("org/springframework/boot/logging/log4j2/log4j2.xml")

Agent Q | PM me for Paid Support
Why do you need the default when you can specify y...

Why I do the same is for configuring logger for tests. For prod the format is dictated by lots of factors. But for tests I prefer having nice and familiar for many people log format. And boot's format 95% matches to my personal "format of my dream". Why not reuse it?)

Roy- Автор вопроса
Dmytro Buryak
For logback there's handy option for this: logback...

Yes, unfortunately log4j2 requires lots of hacks so I reverted to using default logback

Roy
Yes, unfortunately log4j2 requires lots of hacks s...

For most cases, there's no much difference in the end. Both logback and log4j2 are good. And in most cases those are used through slf4j. So main difference usually ends when initial configuration is done. And both have many appenders for each integration, so that also doesn't matter. The only thing why I prefer to use log4j2 directly in non-library code, if I have power to make that decision, is because of one super-simple and yet super powerful feature: it has lazy evaluation support for parameters. But apart from it, there's no much notable differences, especially if all logging is done through slf4j.

Roy- Автор вопроса

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта