Home  >  Article  >  Operation and Maintenance  >  What to do if docker logs are garbled?

What to do if docker logs are garbled?

藏色散人
藏色散人Original
2022-10-21 15:15:433767browse

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".

What to do if docker logs are garbled?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn