From 33313158f092fff69ac5e5310819b8c4370ef774 Mon Sep 17 00:00:00 2001 From: Kris Budde Date: Wed, 5 May 2021 14:58:17 +0200 Subject: [PATCH] added timezone to promtai dry-run logger output #3679" (#3683) Signed-off-by: Kris Budde --- clients/pkg/promtail/client/logger.go | 2 +- docs/sources/clients/aws/ec2/_index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/pkg/promtail/client/logger.go b/clients/pkg/promtail/client/logger.go index 3f4b2abc6436..1c33335e8bf2 100644 --- a/clients/pkg/promtail/client/logger.go +++ b/clients/pkg/promtail/client/logger.go @@ -74,7 +74,7 @@ func (l *logger) Chan() chan<- api.Entry { func (l *logger) run() { for e := range l.entries { - fmt.Fprint(l.Writer, blue.Sprint(e.Timestamp.Format("2006-01-02T15:04:05"))) + fmt.Fprint(l.Writer, blue.Sprint(e.Timestamp.Format("2006-01-02T15:04:05-0700"))) fmt.Fprint(l.Writer, "\t") fmt.Fprint(l.Writer, yellow.Sprint(e.Labels.String())) fmt.Fprint(l.Writer, "\t") diff --git a/docs/sources/clients/aws/ec2/_index.md b/docs/sources/clients/aws/ec2/_index.md index 7e90fd5f8d8a..a71d403b34c1 100644 --- a/docs/sources/clients/aws/ec2/_index.md +++ b/docs/sources/clients/aws/ec2/_index.md @@ -166,7 +166,7 @@ Alright we should be ready to fire up promtail, we're going to run it using the If everything is going well Promtail should print out log lines with their labels discovered instead of sending them to Loki, like shown below: ```bash -2020-07-08T14:51:38 {filename="/var/log/cloud-init.log", instance="i-041b0be05c2d5cfad", name="promtail-demo", zone="us-east-2c"} Jul 07 21:37:24 cloud-init[3035]: util.py[DEBUG]: loaded blob returned None, returning default. +2020-07-08T14:51:38-0700 {filename="/var/log/cloud-init.log", instance="i-041b0be05c2d5cfad", name="promtail-demo", zone="us-east-2c"} Jul 07 21:37:24 cloud-init[3035]: util.py[DEBUG]: loaded blob returned None, returning default. ``` Don't hesitate to edit the your config file and start Promtail again to try your config out.