I am investigating migrating from log4j 1 to log4j 2. A pattern that I have in
many of my applications is setting the log level based on command line
arguments. So if the -v (verbose) option is passed I set the log level to
Info. The default is set to warn.
if (line.hasOption("v"))
{
But I see duplicated lines in the output.
INFO [main]: Hello World
11:36:18.191 [main] INFO verbose - Hello World
What am I doing wrong?
Thanks,
Arwen
-Original Message-----
From: Arwen Pond
Sent: Wednesday, August 06, 2014 10:42 AM
To: log4j-user@logging.apache.org
Subject: Set the log level b
Do you have to specify a root logger in the configuration?
additivity="false" solved my issue. Thanks.
-Original Message-
From: Ralph Goers [mailto:ralph.go...@dslextreme.com]
Sent: Wednesday, August 06, 2014 1:17 PM
To: Log4J Users List
Subject: Re: Set the log level based on command l
My application takes a parameter where the user can specify the log file. I'd
like to pass this parameter to the Logger which uses a FileAppender. I am not
sure how to do this in log4j 2.
Thanks,
Arwen
This electronic mail message contains information that (a) is or
may be CONFIDENTIAL, PROP
I have multiple applications that use log4j. Some depend on others. For
example application A can be run independently and has a log4j config file
under src/main/resources/log4j2.xml. Application B invokes application A but
it has a different log4j config file in its resource directory.
When
have separate configurations. If they run in the same
process, they'll share a config. Which config file is used depends on your
classpath and system properties when you started that process.
Sent from my iPhone
> On 2014/08/09, at 3:28, Arwen Pond wrote:
>
> I have multiple app