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

What to do if docker logs are garbled?

藏色散人
Release: 2022-10-21 15:15:54
Original
3832 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template