Log is empty if website is redirected to example.com.
Log has all the info if not redirected. @magikstm, you are right. The forum remove some symbols when I paste content of caddyfile. I edited my post just now. This log does not record anything before redirection.
hi magikstm
Your code worked. After I got your code I cleared my browser cache to test again and worked. Now I am sure caddy log will do record before redirect. Thank you very much you have solved my confusion.