geisonbiazus / blog

MIT License
29 stars 3 forks source link

Log server requests #7

Closed geisonbiazus closed 3 years ago

geisonbiazus commented 3 years ago

Log server requests in JSON format:

web: 2021/05/04 07:20:05 Starting server on port 3000
web: 2021/05/04 07:20:15 {"type":"request","method":"GET","path":"/","status":200}
web: 2021/05/04 07:20:15 {"type":"request","method":"GET","path":"/static/styles.css","status":200}
web: 2021/05/04 07:20:15 {"type":"request","method":"GET","path":"/static/favicon/site.webmanifest","status":200}
web: 2021/05/04 07:20:15 {"type":"request","method":"GET","path":"/static/favicon/favicon-32x32.png","status":200}
web: 2021/05/04 07:20:17 {"type":"request","method":"GET","path":"/","status":200}
web: 2021/05/04 07:20:17 {"type":"request","method":"GET","path":"/static/favicon/favicon-32x32.png","status":200}
web: 2021/05/04 07:20:18 {"type":"request","method":"GET","path":"/","status":200}
web: 2021/05/04 07:20:18 {"type":"request","method":"GET","path":"/static/favicon/favicon-32x32.png","status":200}
web: 2021/05/04 07:20:18 {"type":"request","method":"GET","path":"/","status":200}
web: 2021/05/04 07:20:18 {"type":"request","method":"GET","path":"/static/favicon/favicon-32x32.png","status":200}
web: 2021/05/04 07:20:24 {"type":"request","method":"GET","path":"/posts","status":200}
web: 2021/05/04 07:20:25 {"type":"request","method":"GET","path":"/posts/test-post","status":200}
web: 2021/05/04 07:20:28 {"type":"request","method":"GET","path":"/","status":200}
web: 2021/05/04 07:20:33 {"type":"request","method":"GET","path":"/","status":200}
web: 2021/05/04 07:20:34 {"type":"request","method":"GET","path":"/","status":200}
web: 2021/05/04 07:20:34 {"type":"request","method":"GET","path":"/posts","status":200}
web: 2021/05/04 07:20:35 {"type":"request","method":"GET","path":"/posts","status":200}
web: 2021/05/04 07:20:35 {"type":"request","method":"GET","path":"/posts","status":200}
web: 2021/05/04 07:20:36 {"type":"request","method":"GET","path":"/posts","status":200}
web: 2021/05/04 07:20:38 {"type":"request","method":"GET","path":"/","status":200}
web: 2021/05/04 07:20:42 {"type":"request","method":"GET","path":"/posts","status":200}
web: 2021/05/04 07:20:45 {"type":"request","method":"GET","path":"/posts/test-post","status":200}
web: 2021/05/04 07:21:25 {"type":"request","method":"GET","path":"/posts/test-post//","status":301}
web: 2021/05/04 07:21:25 {"type":"request","method":"GET","path":"/posts/test-post/","status":200}
web: 2021/05/04 07:21:32 {"type":"request","method":"GET","path":"/posts","status":200}
web: 2021/05/04 07:21:34 {"type":"request","method":"GET","path":"/posts/","status":404}