Looking at the below JIRA tickets, that is supposed to be fixed in 2.8. What Log4j version are you using?
Please see https://issues.apache.org/jira/browse/LOG4J2-1589 https://issues.apache.org/jira/browse/LOG4J2-1243 You can try modifying (Shameless plug) Every java main() method deserves http://picocli.info > On Mar 1, 2018, at 19:40, Michael Heinen <mhn4...@googlemail.com> wrote: > > I would like to use a system var in the file name. If it is not specified an > environment var should be used as fallback. > > I tried > 1) fileName="${sys:valueA:-env:valueB}/foo.log" > 2) fileName="${sys:valueA:-${env:valueB}}/foo.log" > 3) <Properties> > <Property name="valueA">${env:valueB}</Property> > </Properties> > fileName="${sys:valueA}foo.log" > > None of them worked. > Is there any way to achieve this? > > Thanks, > Michael > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org > For additional commands, e-mail: log4j-user-h...@logging.apache.org >