I enabled port forwarding from my router to the machine where I have hosted tomcat instance (port 80 to port 8080). But I see the access logs are not getting generated when I access the website from outside my machine (even in the same network).
The logs are getting generated only when I access the website from within the server machine itself (tomcat instance).
I have the default setting for writing logs in tomcat 8.
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
Update: Though I can access the website using domain name and also using public IP address from anywhere, tomcat only logs the traffic which is generated by accessing the site using IP address and not by domain name.
123.456.123.456/mysite - writes the access log
www.example.com/mysite - doesn't write access log
What can be the cause of this?