Solution to garbled docker logs: 1. Add "ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8" to the dockerfile; 2. Select "Edit Custom VM Options" And add "Dfile.encoding=utf-8".
The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.
What should I do if docker logs are garbled?
Docker log garbled solution:
1. Add three lines of configuration to the dockerfile
ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8
2. idea help -> Edit Custom VM Options
Add-Dfile.encoding=utf-8
Related introduction:
docker logs: Get the log of the container
Syntax
docker logs [OPTIONS] CONTAINER
OPTIONS Description:
-f: Trace log output
--since: Display all logs at a certain start time
-t: Display timestamp
--tail: Only list the latest N container logs
Recommended learning: "docker video tutorial"
The above is the detailed content of What to do if docker logs are garbled?. For more information, please follow other related articles on the PHP Chinese website!