nginx acess.log 日志文件全是 16 进制怎么解决
log_format main escape=json ‘$remote_addr – $remote_user [$time_local] “$request” ‘ ‘$status $body_bytes_sent “$http_referer” ‘ ‘”$http_user_agent” “$http_x_forwarded_for”‘;
access_log /var/log/nginx/access.log main;
看网上用了 escape=json 转为 json 格式,但是还是没有用,很烦。 日志这个鬼样子,查错都查不了。
172.96.241.213 – [11/Apr/2021:17:53:47 +0800] “u0016u0003u0001u0002u0000u0001u0000u0001üu0003u0003Ou0012~Zf¶Üu000FGyå2.;®æÕèt<û[email protected]é-¦ yL§D ä<97>ð´ªg<9d>6YY×(ÍWT¥þu000E2©úû>Y«}]¸Ò1N;u0000″úúu0013u0001u0013u0002u0013u0003À+À/À,À0̨̩Àu0013Àu0014u0000<9c>u0000<9d>u0000/u00005u0000” 400 157 “” “” “” 192.241.210.208 – [11/Apr/2021:17:58:20 +0800] “u0016u0003u0001u0000<8b>u0001u0000u0000<87>u0003u0003<95>u0011~¨áÀ-<88>lu0010ôu0012<97>Ê;u0013u0007þ8u0019XfT#u000B1À<9c>8Nu00073u0000u0000u001AÀ/À+Àu0011Àu0007Àu0013ÀtÀu0014À” 400 157 “” “” “” 193.142.146.84 – [11/Apr/2021:17:59:50 +0800] “GET / HTTP/1.1” 200 612 “” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0” “”