<p>Is it possible to reference system environment variables (as opposed to Java system properties) in a log4j xml configuration file?</p>

<p>I'd like to be able to do something like:</p>

<pre><code>&lt;level value="${env.LOG_LEVEL}" /&gt;
</code></pre>

<p>and have it get that from the system environment variables, so I can avoid having to pass in so many things with -D parameters.</p>

I tried to do that recently and couldn't get it to work. What I ended up doing is sending a variable at startup. So say you have an environment variable called $LOG_LEVEL:
```
```
<level value="${log_level}" />
```
```
and at startup...
```
```
java -Dlog_level=$LOG_LEVEL your_app
```
```