You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2014/08/20 15:36:25 UTC

[jira] [Resolved] (LOG4J2-771) Add lookup for application main arguments

     [ https://issues.apache.org/jira/browse/LOG4J2-771?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory resolved LOG4J2-771.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1

> 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
>             Fix For: 2.1
>
>         Attachments: mainlookup.diff
>
>
> 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)

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