Skip to content

Commit

Permalink
added timezone to promtai dry-run logger output #3679" (#3683)
Browse files Browse the repository at this point in the history
Signed-off-by: Kris Budde <Kris@budd.ee>
  • Loading branch information
kbudde authored May 5, 2021
1 parent 735e8dc commit 3331315
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clients/pkg/promtail/client/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/clients/aws/ec2/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3331315

Please sign in to comment.