3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Dockerのログを時間指定してテキストファイルに出力

Posted at

はじめに

docker-composeを使ってコンテナを複数作成するとき、特定のコンテナのログを時間指定してみたい時があります。特に、linuxでdockerを動かしていると、ログの解析が難しいので(自分の技術力の問題かも。)、テキストファイルに出力して、VScodeなどでログ解析する方法を紹介します。

実装方法

以下コマンドで実現できます。

docker logs <container name> --since xxxx-xx-xxTxx:xx:xx --until yyyy-yy-yyTyy:yy:yy > docker_log.txt

参考文献

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?