Closed ebanDev closed 2 years ago
Oops, my bad. It needs slight adjustments. The correct template in Caddyfile is:
format formatted `{request>remote_addr} - {request>user_id} [{ts}] "{request>method} {request>uri} {request>proto}" {status} {size} "{request>headers>Referer>[0]}" "{request>headers>User-Agent>[0]}"`
So for you it should be
format formatted `{request>remote_addr} - {request>user_id} [{ts}] "{request>method} {request>uri} {request>proto}" {status} {size} "{request>headers>Referer>[0]}" "{request>headers>User-Agent>[0]}"` {
time_format "02/Jan/2006:15:04:05 -0700"
}
Edit: here's the output with that exact config:
127.0.0.1 - - [1647204054.825556] "GET / HTTP/2.0" 200 20590 "-" "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
127.0.0.1 - - [1647204054.9815192] "GET /favicon.ico HTTP/2.0" 404 0 "https://localhost/" "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
Hi, I tried to make the combined (nginx) log format whit this plugin, but it doesn't seem to work :( Here is my template
But the result is not as excepted :(