1. Problem description:In the Linux environment Centos operating system, after downloading the Jenkins image through Docker, a container was created, and the Jenkins address was accessed through the server IP+port, and the relevant configuration was performed. Then a task job was created to build and run the Java+Selenium automated test script. The current build is Success. The only drawback is that the printed log appears garbled, as shown below: (Note: The execution machine is Jenkins itself, the same machine) 2. Troubleshoot Jenkins settingsJenkins system settings view the language part in the global properties 2. Jenkins detailed information (add /systemInfo after the browser Jenkins address) 3. Code log encoding method1. Check if the printed log is utf-8. It is confirmed that it is 4. Linux server language information 1. Check the host language configuration and enter the command: 2. View /.vimrc I didn't dare to change it here because it would not affect the scope. I just found the article on CSDN. This is not very clear, the answer given online is: https://blog.csdn.net/u010189459/article/details/38338735 The general meaning is that in vimrc, encoding can set these items at the same time:
5. Final investigationNow that the Jenkins system settings and the host language have been checked, let's start checking the container 1. Enter the Jenkins container docker exec -it container ID /bin/bash View Language Then enter Write at the end of /etc/bash.bashrc, then lc_all actually assigns values to all the variables above, and the effect is the same, but it doesn't hurt to try. Generally speaking, there is no such thing. Docker itself has a complete operating system and has nothing to do with the host machine. 2. Enter the Chrome browser container 3. Then modify the global properties of the Jenkins system settings, change the previous LANG = zh_CN .UTF-8 to LANG = C.UTF-8. The reason is: at present, the server market is basically occupied by centos and debian. Centos relies on redhat, debian is self-sourced, centos is derived from redhat, various patches and services are more complete, centos is also used as a server. If I am not wrong, the host machine where Jenkins is located uses the debian system instead of centos, because the locale in debian supports zh_CN.UTF-8, and centos supports C.UTF-8 Finally, restart the Jenkins service (add /restart after the Jenkins address), then start the task and view the log of the Jenkins console! Postscript: It may be that the language needs to be set in the container. It may be related to the Jenkins system setting of the global property language LANG = C.UTF-8. Summarize The above is the problem of garbled Chinese characters appearing in the console log when building Jenkins tasks in the Docker environment introduced by the editor. I hope it will be helpful to everyone! You may also be interested in:
|
<<: Example of how to check the capacity of MySQL database table
>>: JavaScript implements large file upload processing
Preface The notification bar component is a relat...
This article introduces the development environme...
Background Controller @RequestMapping("/getP...
In the past few days, I have studied how to run s...
It is common to view code effects in different br...
Table of contents 1. Introduction 2. Direct recov...
Purpose: Nested use of MySQL aggregate functions ...
This article shares the specific code of the WeCh...
MySQL-Group-Replication is a new feature develope...
1. Command method Run the nginx service in the cr...
Application scenario 1: Domain name-based redirec...
If you want to transfer files between Windows and...
Two days ago, I took advantage of the Double 11 s...
1. Unzip MySQL 5.7 2. Create a new configuration ...
The table caption can be placed above or below th...