I'm nervous socket.fqdn() may actually return a different value than the SERVER_NAME header, which could be confusing if you were trying to cross-reference the event log with the server logs...

Specifically, I believe socket.fqdn() does a reverse DNS lookup.  I'm not sure what the strategy is for generating the SERVER_NAME value, but it could be different.  I try not to rely on reverse DNS since I perceive it as optional... in practice I imagine most networks have it set up, so I may concern may not actually be terribly well founded :wink: