Thanks...I haven't seen the machinename property show up as null...I'll check it out..maybe add a finally/null check for the property to make sure it is set to 'unknown'.
How about
try { localMachine = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException uhe) { try { localMachine = InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException uhe2) { // nothing to do } }
if(localMachine == null) { localMachine = "unknown"; }
I thought I'd give a little background as to why I added the 'overrideProperties' property and the reasoning behind log4japp supporting the odd concatenation:
1. The overrideProperties is used when I want to forward events to SimpleSocketServer (from an server app for example). If the overrideproperties didn't exist, the log4japp and log4jmachinename would be the name of the machine running SimpleSocketServer, not the 'source' machine.
Before setting the property, you can check if it is already set in the LoggingEvent. If it is, then there is no need to set it again...
2. The reason I provided 'concatenation' of the log4japp property is because static configuration via the XML file wasn't flexible enough for my needs. I end up using the app property to create unique tabs for each user running on the same machine (using the same xml configuration file).
Have you tried variable substitution?
[snip]
I'd still like this functionality. Can you think of another way?
Variable substitution... but I am repeating myself. :-)
Thanks again, Scott
--
Ceki For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]