Skip to content

Commit

Permalink
fix: LookupAttribute time format
Browse files Browse the repository at this point in the history
Signed-off-by: wenfeng <[email protected]>
  • Loading branch information
wenfengwang committed Dec 15, 2022
1 parent a8bb18f commit a74cef0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/trigger/util/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func LookupAttribute(event ce.Event, attr string) (interface{}, bool) {
case "id":
return event.ID(), true
case "time":
return event.Time().String(), true
return event.Time().Format(time.RFC3339), true
case "dataschema":
return event.DataSchema(), true
case "datacontenttype":
Expand Down
3 changes: 2 additions & 1 deletion observability/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Logger interface {

func init() {
logger := logrus.New()
logger.Formatter = &logrus.TextFormatter{TimestampFormat: time.RFC3339Nano, FullTimestamp: true}
logger.Formatter = &logrus.TextFormatter{TimestampFormat: time.RFC3339, FullTimestamp: true}
r := &defaultLogger{
logger: logger,
}
Expand All @@ -53,6 +53,7 @@ func init() {
default:
r.logger.SetLevel(logrus.InfoLevel)
}

vLog = r
vLog.Debug(context.Background(), "logger level has been set", map[string]interface{}{
"log_level": level,
Expand Down

0 comments on commit a74cef0

Please sign in to comment.