AbstractConfiguration#initialize - making two passes generates invalid configuration - no check if initialization has already been performed
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia con AbstractConfiguration#initialize e Configuration#doConfigure, quindi esamina il caso Configurator1Test esistente menzionato nel report. Riproduci la sequenza builder.build() seguita da config.initialize() e verifica che una seconda inizializzazione non elimini gli appender CONSOLE e RollingFile configurati né altre configurazioni annidate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Log4j 2.24.3
Repeated calls to the Configuration#doConfigure method discard appenders (and maybe other inforrmation).
In my example, I have a configuration with two defined appenders ("CONSOLE" and "RollingFile").
Taken from another test case, lets assume I use a BuiltConfiguration with a ConfigurationBuilder and create the and initialized configuration and then initialize it again (the first initialization happens in the build method if I don't call builder.build(false). (Admittedly, this is redundant and strictly incorrect; however, it is possible and I found an instance of this in the Configurator1Test unit-test.)
final Configuration config = builder.build();
config.initialize();
In the first pass, the rootNode tree is processed and through a call to PluginElementVisitor#visit(....) all nested nodes are removed and the top level child node is assigned an built object.
If a second pass is made, the config.initialize() method performs no check to see if it has already been initialized (State.INITIALIZED or later). This results in another runthrough of doConfigure() and now the child nodes are missing because they have been visited and removed,
Here before the 2nd-pass of createConfigurationon the "Appenders" node:
Now however, due to the missing child information, the object list of configured appenders is empty and the two previously defined appenders are gone.
So the second configure cleared the previous run's appenders (and possibly other nested configuration).
I think the easy solution would be to test the state in the initialize method and if not INITIALIZING just log and return; however, I don't know if that would have other side-efffects.
- Lingua principale
- Java
- Stelle
- 3.6k
- Fork
- 1.8k
- Merge medio
- 5g 6h
- PR unite (30g)
- 24
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/logging-log4j2
-
additivity attributeApertawaiting-for-maintainer
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
apache/logging-log4j2#4475 ·
I maintainer di solito rispondono entro 1 giorno
-
Migrate `log4j-api-test` tests to JUnit 5Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertaapi priority: P3 tests waiting-for-maintainer
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/logging-log4j2#4430 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
`Rfc5424Layout` does not escape the `newLineEscape` replacement in SD-PARAM-VALUEForse già presa @lunarbae628 l’ha presa 5 giorni fa. Apertabug layouts priority: P3
apache/logging-log4j2#4464 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
configuration enhancement layouts
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
apache/logging-log4j2#4463 ·
I maintainer di solito rispondono entro 1 giorno
-
`evaluateOnStartup="true"` saves logs under wrong file names after missing scheduled rollForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertaappenders:Rolling bug priority: P1 waiting-for-maintainer
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
apache/logging-log4j2#4449 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/logging-log4j2
Issue simili
-
[Bug]: Nullable implicit operator on string extensible enums still throws for a null stringForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug emitter:client:csharp
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/typespec#12572 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Java SDK MountRequest always sends update-optional fields, resetting stored mount settingsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configurationForse già presa @amalsaidov l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni