title: Tomcat 7 logging separation by host name
body: <p>I use a Tomcat 7 installation as web container for multiple virtual hosts. Each web app has its own set of log files that I separate by hostname, e.g. /logs/www.somehost.com/logfile.log and /logs/www.anotherhost.com/logfile.log.</p>
  
  <p>I would like to separate the logging from Tomcat itself (e.g. catalina.*, tomcat7-stderr.*, and tomcat7-stdout.*) by host name also, but I cannot see how to do this in Tomcat 7. The <a href="https://tomcat.apache.org/tomcat-8.5-doc/logging.html#Using_java.util.logging_(default)" rel="nofollow noreferrer">documentation</a> for Tomcat 8.5 refers to a property replacement <code>${classloader.hostName}</code>, but this does not seem to work in Tomcat 7.</p>
  
  <p>Is it possible to dynamically set the folder name for Tomcat 7 logging through base <code>logging.properties</code> file? Can I reference the <code>Host name</code> as defined in <code>server.xml</code> for property replacement in a context-deployed <code>logging.properties</code> file?</p>