1. Description of the problem:
On Windows, I had previously been using Secure CRT Linux host connection for remote operation, using the CRT logging records all operation and output connections in the process.
Recently (2019-8-17) using Xshell connection, also intends to logging, but found that logging a problem, it's not garbage, but feel Xshell log records
Linux system is connected to all of the operation contents of color, color control codes are replaced under Linux, such as:
echo -e "\ 033 [32; 41; 1m this is echo color input test \ e [0m." Results are as follows:
However, it will log records echo -e "\ 033 [32; 41; 1m this is echo color input test \ e [0m." This string, instead of recording this is echo color input test.
Obviously, when we have a command line prompt color, and ls lists the content will automatically display color, may also have a number of other command output color, are recorded with a string of color control
Character command, we read up on and garbled no difference, and unfriendly, then how do we solve it? Read on! ! !
Xshell of the following configuration is preferably configured " Default Session Properties " , not separately arranged connection properties. Because here is a demonstration, we do not pay attention to these.
2, simulation problem:
FIG Xshell logging configuration:
Connection to a Linux host, do something, the contents of the log record is as follows:
3, problem solving:
The reason for the above problem is we configure the record "when logging terminal codes ."
千万不要勾选上图中的“包括终端代码”一项!!!
去掉勾选,我们再来尝试连接Linux主机,做一些操作后,日志记录的内容如下:
到此问题解决!