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
Add an input file HTML control to the web page: &...
Table of contents 1. Introduction 2. Prepare the ...
In the horizontal direction, you can set the alig...
Loading rules of require method Prioritize loadin...
background go-fastdfs is a distributed file syste...
Table of contents 1. Background 2. Operation step...
This article shares the specific code of JavaScri...
Recently, I used html-webapck-plugin plug-in for ...
Table of contents Overview definition Instance Me...
Table of contents 1. Operators Summarize 1. Opera...
Uninstall the installed version on Ubuntu: sudo a...
Table of contents Preface ErrorBoundary Beyond Er...
Recently, due to business adjustments in the comp...
Mysql supports 3 types of lock structures Table-l...
Table of contents Configure node.js+nvm+npm npm s...