Skip to content

Commit

Permalink
Fix bug #44: Replace logrus.DefaultTimestampFormat with time.REFC3339 (
Browse files Browse the repository at this point in the history
  • Loading branch information
poulikov authored and ripcurld0 committed Sep 27, 2017
1 parent d2c0ecc commit dbc1e22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion logstash_formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"strings"
"time"

"github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -44,7 +45,7 @@ func (f *LogstashFormatter) FormatWithPrefix(entry *logrus.Entry, prefix string)
timeStampFormat := f.TimestampFormat

if timeStampFormat == "" {
timeStampFormat = logrus.DefaultTimestampFormat
timeStampFormat = time.RFC3339
}

fields["@timestamp"] = entry.Time.Format(timeStampFormat)
Expand Down

0 comments on commit dbc1e22

Please sign in to comment.