-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Curtis,

(Marking OT because this has nothing to do with Tomcat).

On 4/23/2010 11:06 AM, Curtis Garman wrote:
> Does anyone know if it is possible to access the HOSTNAME environment
> variable in a log4j.properties file. Basically I'm using the email appender
> and would like to include the host in the email subject line so I can easily
> determine which server generated the email. I can hard-code this info but I
> was thinking there might be a way that tomcat can read something like
> 
> log4j.appender.email.subject=Java Application Error (${HOSTNAME})

If you use a PropertyConfigurator
(http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html)
you can use system properties, but not environment variables. That
should be easy to work around: add "-Dmyhostname=${HOSTNAME}" to your
startup scripts.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvRzFYACgkQ9CaO5/Lv0PDagACgkWm1usi9TUZvJxD/MItGA0kR
RAMAnidhGCjbFWN2PwJtj4EWxfl55dV6
=3k2o
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to