Hi Piotr,
Thank you so much for your valuable response.

The explanation about the arbitrary string identifiers is what I was
looking for, I changed the identifiers and the logging is working.
However, can you brief me on what a concrete logger is exactly and how is
it different from other logger configs?

And I will consider your advice of switching to a different format for
configuration file than properties.
However in our project we have 2 files present simultaneously XML and
properties and by default, log4j2 picks the properties file, can you
suggest how to turn off this default behavior programmatically?
I know we can pass a java property  -Dlog4j.configuration but I want to
know if there is an alternative way to do it via code.

Regards,
Nilay

On Wed, May 4, 2022 at 9:37 PM Piotr P. Karwasz <piotr.karw...@gmail.com>
wrote:

> Hi Nilay,
>
> On Wed, 4 May 2022 at 14:49, Nilay Prafulla Dhamecha
> <npraf...@tibco.com.invalid> wrote:
>
> > *Old Properties file (Log4j1.x) : *
> > *#Appenders*
> > log4j.appender.file_logger=com.share.util.LogFileAppender
> > ...
>
> *Migrated Properties file (Log4j2.17.1) : *status = warn
> > ...
> > appender.file_logger.type=BWLogFile
> > ...
> > Can you please let us know if the migration is done correctly or if there
> > are any errors in it?
> > We are unsure about the loggers defined in red color.
> >
>
> Syntactically the configuration is correct (provided that you wrote an
> appender plugin called "BWLogFile"), but it is impossible to compare the
> functionality since "com.share.util.LogFileAppender" is a custom Log4j 1.x
> appender. Can you describe what functionality does this appender implement?
> There is certainly a standard Log4j2 appender for that!
>
> Basically, we want clear information about  logger.*console_logger*
> > .appenderRef.*bw_console.ref* = *console_logger*  this line, can you
> guide
> > us as to what should come in these placeholders
> > *logger.<1>.appenderRef.<2>.ref
> > = <3>*
> >
>
> <3> must be equal to the "name" property of an appender.
>
> <1> and <2> can be arbitrary string identifiers without any dots in it.
> They appear only in the properties format and are necessary to distinguish
> the properties that apply to a concrete logger configuration from those of
> other logger configs.
>
> Remark that the properties configuration format is not the standard Log4j2
> configuration format and is probably the hardest to learn. You should
> consider any other format.
>
> Piotr
>

Reply via email to