檢視docker容器日誌

2021-09-23 18:15:08 字數 627 閱讀 9375

檢視names為lcn的日誌

docker logs -f -t --tail 100 lcn
命令格式:

$ docker logs [options] container_id或names

options:

--details 顯示更多的資訊

-f, --follow 跟蹤實時日誌

--since string 顯示自某個timestamp之後的日誌,或相對時間,如42m(即42分鐘)

--tail string 從日誌末尾顯示多少行日誌, 預設是all

-t, --timestamps 顯示時間戳

--until string 顯示自某個timestamp之前的日誌,或相對時間,如42m(即42分鐘)

例子:

檢視指定時間後的日誌,只顯示最後100行:

docker logs -f -t --since="2019-02-08" --tail=100 container_id

docker 檢視docker容器日誌

1 命令格式 docker logs options container options details 顯示更多的資訊 f,follow 跟蹤實時日誌 since string 顯示自某個timestamp之後的日誌,或相對時間,如42m 即42分鐘 tail string 從日誌末尾顯示多少行日...

docker檢視容器日誌

檢視容器日誌的方法一般是使用docker logs命令,下面介紹一下這個命令如何使用。usage docker logs options container options details 顯示更多的資訊 f,follow 跟蹤實時日誌 since string 顯示自某個timestamp之後的日...

Docker容器應用日誌檢視

docker attach options 容器會連線到正在執行的容器,然後將容器的標準輸入 輸出和錯誤流資訊附在本地列印出來。命令中options的取值有三種 detach keys,no stdin,sig proxy。該命令只是進入容器終端,不會啟動新的程序。所以當你同時使用多個視窗進入該容器...