Closed phillipj closed 6 years ago
I thought of adding a proper logging system as well. Thanks!
I think the log should be human readable and not JSON? Or if it is JSON I'd prefer if it is GKE-compatible (I can't find a proper docs on this. It seems to be not documented well) Basically, if you write JSON lines the fluentd in GKE will try to parse them and Stackdriver Logging will show the log lines with correct log level.
I think the log should be human readable and not JSON?
Yeah, I would agree readable when grepping logs manually, otherwise JSON is better i.e. for sending logs off with fluentd to some log management solution.
bunyan CLI for the rescue to get readable logs:
$ KUBE_USE_KUBECONFIG=true KUBE_USE_CLUSTER=false SLACK_URL=https://example.com node . | bunyan -o short
09:23:53.220Z INFO kube-slack: Kubernetes monitors started
works just as well with logs directly from kubectl
:
$ kubectl logs graphql-f646d6b9d-k8l82 | bunyan -o short
12:42:34.597Z INFO graphql: GraphQL Server is now running on http://localhost:8080
That CLI's filtering options is also really valuable at times!
Not too opinionated about bunyan or other alternatives though, I just really appreciate a little more structured logs.
Now released in latest tag.
Sorry for the long wait, I forgot that this repo has no automated build (as it was moved from whs/kube-slack and Docker Hub not updating the hook)
Thanks! What's your process for pushing a new version tag, anywhere I can follow to get notified? Wondering so I know when I can bump to the next fixed version.
I usually publish when I have a bugfix or a feature.
We just have an intern joined us. He'll work on some of the feature requests, so I estimate that the next release will be by next week.
On Fri, Jun 1, 2018, 5:44 PM Phillip Johnsen notifications@github.com wrote:
Thanks! What's your process for pushing a new version tag, anywhere I can follow to get notified? Wondering so I know when I can bump to the next fixed version.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/wongnai/kube-slack/pull/32#issuecomment-393844010, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVFiyyF7xhTdomWkE1NmHiA2dJGGB7wks5t4RsfgaJpZM4TyrPe .
Sorry for the long wait, I've just published v3.4.0 in Docker Hub. :tada:
Hooooray! Thanks a lot 👍
Structured logs with timestamp included is incredibly valuable when trying to debug any issues or just want to double check if everything is still running as expected.
bunyan is a proven logger that outputs JSON to stdout.
Example of running this locally:
Lots of ways to alter the bunyan output while running locally or searching through the logs when it runs in the Kubernetes cluster with the bunyan CLI.
Would you consider this useful in this project?
Refs https://github.com/trentm/node-bunyan