Skip to content

Commit

Permalink
Merge pull request sirupsen#346 from e-max/logstash_formatter_race
Browse files Browse the repository at this point in the history
race in logstashformatter.go
  • Loading branch information
aybabtme committed Apr 16, 2016
2 parents 7e6f976 + 8a870e4 commit ed4b7af
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 ed4b7af

Please sign in to comment.