TarsCloud / Tars

Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.
BSD 3-Clause "New" or "Revised" License
9.8k stars 2.08k forks source link

[BUG]Windows平台tarsnode拉取日志有问题 #860

Open JanuarYJL opened 3 years ago

JanuarYJL commented 3 years ago

What version of TARS and what language are you using? v2.4.14

What operating system (Linux, Windows, ...) and version? [e.g. CentOS 7.8] Win7

What runtime/compiler are you using? [e.g. JDK version or version of gcc] VS2019

Describe the bug Logview本地日志查询无法查看Windows节点程序的日志,原因是在Windows平台的tarsnode中会将tail/iconv/sed转换成使用busybox的命令(参见NodeImp.cpp文件中的NodeImp::getLogData函数),即:busybox.exe tail -5000 c:\tars-install\tars\app_log\tars\tarsAdminRegistry\tars.tarsAdminRegistry1.log | busybox.exe tail -100 | busybox.exe iconv -c -f UTF-8 -t UTF-8 | busybox.exe sed 's/[\cA-\cZ]//g',但是busybox并不支持iconv且对sed的参数支持也有问题,如图后面截图所示。

Screenshots issue2

issue1

Additional context 是否考虑将iconv等busybox不支持的命令执行文件直接打包到Windows平台的框架中?

ruanshudong commented 3 years ago

这个问题你有什么好的解决建议么?

sandshaw commented 2 years ago

使用这个版本的busybox。 https://frippery.org/files/busybox/busybox.exe

JanuarYJL commented 2 years ago

使用新版的busybox.exe可以支持iconv,但是执行sed 's/[\cA-\cZ]//g'命令时无法识别单引号,改成双引号或者去掉引号可用,但是[\cA-\cZ]的匹配有问题,不知道为什么没有正确识别,反而是只识别出了大写字母,目前是直接把最后的sed命令去掉来使用