vy commented on issue #2185: URL: https://github.com/apache/logging-log4j2/issues/2185#issuecomment-1889464464
Hello @AmanDaharwal! I don't know what kind of a help you are looking for, but I don't find it safe to clone a repository from an unknown source and run it on my machine. Could you provide us a more minimalist example, please? That is, your Log4j configuration and a sample Java file to trigger the issue. Until that time, I will try to help as follows. I see your [log4j2.properties](/AmanDaharwal/getting-started-with-teswiz/blob/log4jTest/src/test/resources/log4j2.properties) and [Log4jTestStep.java](https://github.com/AmanDaharwal/getting-started-with-teswiz/blob/log4jTest/src/test/java/com/znsio/sample/e2e/steps/Log4jTestStep.java). I adopted these into following `log4j2.xml`: ``` <?xml version="1.0" encoding="UTF-8"?> <Configuration> <Appenders> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss,SSS}] %-5p [%c.%M()] (%t) %m%n"/> </Console> <File name="File" fileName="${env:LOG_DIR}/foo.log"> <PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss,SSS}] %-5p [%c.%M()] (%t) %m%n"/> </File> </Appenders> <Loggers> <Root level="info"> <AppenderRef ref="Console"/> <AppenderRef ref="File"/> </Root> </Loggers> </Configuration> ``` and `Log4j2Issue2185.java`: ``` package ci.yazi.volkan; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class Log4j2Issue2185 { private static final Logger LOGGER = LogManager.getLogger(); public static void main(String[] args) { LOGGER.info("INFO ->>>>>>>>>>>>>>>"); LOGGER.trace("TRACE ->>>>>>>>>>>>>>>"); LOGGER.debug("DEBUG ->>>>>>>>>>>>>>>"); LOGGER.warn("WARN ->>>>>>>>>>>>>>>"); LOGGER.fatal("FATAL ->>>>>>>>>>>>>"); LOGGER.error("ERROR ->>>>>>>>>>>>>>"); } } ``` It all works fine. If you can provide a minimalist example reproducing the issue in a way I shared above, we can help better. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
