Gary Gregory (JIRA)
2014-08-07 17:02:12 UTC
Gary Gregory created LOG4J2-771:
-----------------------------------
Summary: Add lookup for application main arguments
Key: LOG4J2-771
URL: https://issues.apache.org/jira/browse/LOG4J2-771
Project: Log4j 2
Issue Type: New Feature
Components: Core
Environment: Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T09:51:42-04:00)
Maven home: C:\Java\apache-maven-3.2.2
Java version: 1.7.0_60, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_60\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Reporter: Gary Gregory
Assignee: Gary Gregory
As a user I want to use the following expression in configuration files:
If my static void main String[] arguments are:
--file foo.txt --verbose -x bar
I should be able to say:
- ${main:0} -> --file
- ${main:1} -> foo.txt
- ${main:2} -> --verbose
- ${main:3} -> -x
- ${main:4} -> bar
- ${main:--file} -> foo.txt
- ${main:-x} -> bar
- ${main:bar} -> null
For this to work, I have to call:
{code:java}
public static void main(String args[]) {
//...
MapLookup.setMainArguments(args);
//...
}
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
-----------------------------------
Summary: Add lookup for application main arguments
Key: LOG4J2-771
URL: https://issues.apache.org/jira/browse/LOG4J2-771
Project: Log4j 2
Issue Type: New Feature
Components: Core
Environment: Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T09:51:42-04:00)
Maven home: C:\Java\apache-maven-3.2.2
Java version: 1.7.0_60, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_60\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Reporter: Gary Gregory
Assignee: Gary Gregory
As a user I want to use the following expression in configuration files:
If my static void main String[] arguments are:
--file foo.txt --verbose -x bar
I should be able to say:
- ${main:0} -> --file
- ${main:1} -> foo.txt
- ${main:2} -> --verbose
- ${main:3} -> -x
- ${main:4} -> bar
- ${main:--file} -> foo.txt
- ${main:-x} -> bar
- ${main:bar} -> null
For this to work, I have to call:
{code:java}
public static void main(String args[]) {
//...
MapLookup.setMainArguments(args);
//...
}
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)