You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by JASMINE DASH <da...@gmail.com> on 2024/03/28 11:12:21 UTC

Log4j2 migration issue

Team,

I have recently migrated from log4j1.x to log4j2.x , so I have updated the
jar files , property files ,but still I am not able to log the logger in
the console.
 Could you please guide what need to configure so that I can able to log
the logger in my console.

Please find the below log4j2.properties file.

rootLogger.level = INFO, STDOUT appender = Console
appender.console.name = STDOUT
appender.console.type = Console appender.console.layout.type = PatternLayout

appender.console.layout.pattern = %5p [%t] %C{1}.%M() [%L] -> %m%

rootLogger.appenderRef.stdout.ref = STDOUT

Re: Log4j2 migration issue

Posted by "Piotr P. Karwasz" <pi...@gmail.com>.
Hi Jasmine,

On Thu, 28 Mar 2024 at 12:12, JASMINE DASH <da...@gmail.com> wrote:
> Please find the below log4j2.properties file.
>
> rootLogger.level = INFO, STDOUT appender = Console
> appender.console.name = STDOUT
> appender.console.type = Console appender.console.layout.type = PatternLayout
>
> appender.console.layout.pattern = %5p [%t] %C{1}.%M() [%L] -> %m%
>
> rootLogger.appenderRef.stdout.ref = STDOUT

Your value of the `rootLogger.level` property is invalid, it should
only contain the name of a level like `INFO`. The `appender` property
has no meaning, so you can remove it.

Anyway you should rather use the XML format. An example almost
identical to your configuration is available on our XML schema page:
https://logging.apache.org/xml/ns/

Piotr

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org