Skip to content

Commit

Permalink
fix race
Browse files Browse the repository at this point in the history
  • Loading branch information
e-max committed Apr 15, 2016
1 parent 7e6f976 commit 8a870e4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions formatters/logstash/logstash.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ func (f *LogstashFormatter) Format(entry *logrus.Entry) ([]byte, error) {

fields["@version"] = 1

if f.TimestampFormat == "" {
f.TimestampFormat = logrus.DefaultTimestampFormat
timeStampFormat := f.TimestampFormat

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

fields["@timestamp"] = entry.Time.Format(f.TimestampFormat)
fields["@timestamp"] = entry.Time.Format(timeStampFormat)

// set message field
v, ok := entry.Data["message"]
Expand Down

0 comments on commit 8a870e4

Please sign in to comment.