LoginSignup
0
0

More than 5 years have passed since last update.

GKE試行(その6:「StackdriverLoggingでログレベル別にログ表示」)

Posted at

お題

前回、GKE上でのアプリ公開まで出来た。
その際、StackdriverLoggingでアプリが標準出力に吐いたログも確認してみたわけだけど、一応、ログレベル別の表記ができることも確認してみたい。
というわけで、アプリを改修して、例えば警告レベル、エラーレベルのログも出るようにしてみた。

環境

前回と同じ。


$ kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.7", GitCommit:"dd5e1a2978fd0b97d9b78e1564398aeea7e7fe92", GitTreeState:"clean", BuildDate:"2018-04-19T00:05:56Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.7-gke.6", GitCommit:"9b635efce81582e1da13b35a7aa539c0ccb32987", GitTreeState:"clean", BuildDate:"2018-08-16T21:33:47Z", GoVersion:"go1.9.3b4", Compiler:"gc", Platform:"linux/amd64"}

前提

  • 自前でGCPプロジェクトは契約済み
  • gcloudをローカルで使える状態になっている

実践

アプリ修正してCloud Buildで再ビルドしてGCRから再デプロイして、再度、サービス公開。
で、アクセスしてStackdriverLoggingでログ確認してみると。。。
17.png

うん、Infoレベルと異なる表記(警告は「!」、エラーは「!!」)になっており、severityも"WARNING"、"ERROR"になっているのでフィルタリングもできる。

0
0
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
0
0