Logging the machine name (hostname) in Log4net

If you have a web farm where all servers are logging to the same place, then you’ll likely need to log the machine name as part of the log message. You can use the conversion pattern %P{log4net:HostName} to output the hostname. So, here’s what that looks like in context:





Leave a Reply