You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I will show you two configurations, one that works, one that doesn't, and maybe you understand what is wrong.
If it's not a bug, this requires at least clear documentation warnings on conditionals.
In all cases i have SYSLOG_HOST = localhost in my environment, because I want my UdpJsonAppender to always work to have remote logs, and I want to activate logs on the file system only on dev environments
This first logback.xml works for all combinations of API_LOGS_FS_ENABLED, API_LOGS_TXT_ENABLED: specifically If these two variables are false, I have my last UdpJsonAppender working on the root logger, and the JsonAppender and TextAppender create empty files which are never filled, I guess this is expected.
Whereas in this one, the UdpJsonAppender works only if API_LOGS_FS_ENABLED, API_LOGS_TXT_ENABLED are both true, which is totally unexpected, and makes me think that the root logger evaluates the last if condition only if the appender-ref of JsonAppender and TextAppender are valid, which in this case they are not since their block is also enclosed in a conditional which is false, so the appenders are never declared, but the ifs inside the root are also false so they should be ignored and the one for UdpJsonAppender should still be OK.
This one would have the clear advantage of not creating the resources or the file for the unused appenders, but in practice, it doesn't work.
Hello,
I will show you two configurations, one that works, one that doesn't, and maybe you understand what is wrong.
If it's not a bug, this requires at least clear documentation warnings on conditionals.
This first logback.xml works for all combinations of API_LOGS_FS_ENABLED, API_LOGS_TXT_ENABLED: specifically If these two variables are false, I have my last UdpJsonAppender working on the root logger, and the JsonAppender and TextAppender create empty files which are never filled, I guess this is expected.
Whereas in this one, the UdpJsonAppender works only if API_LOGS_FS_ENABLED, API_LOGS_TXT_ENABLED are both true, which is totally unexpected, and makes me think that the root logger evaluates the last if condition only if the appender-ref of JsonAppender and TextAppender are valid, which in this case they are not since their block is also enclosed in a conditional which is false, so the appenders are never declared, but the ifs inside the root are also false so they should be ignored and the one for UdpJsonAppender should still be OK.
This one would have the clear advantage of not creating the resources or the file for the unused appenders, but in practice, it doesn't work.
The text was updated successfully, but these errors were encountered: