Skip to content

Commit

Permalink
feat(logspout): use custom datetime
Browse files Browse the repository at this point in the history
This commit enables users to specify their own datetime format
by supplying the `DATETIME_FORMAT` environment variable when
using logspout. If none is supplied, logspout will continue to use
`DEIS_DATETIME_FORMAT`.
  • Loading branch information
carmstrong committed Feb 6, 2015
1 parent 76cd8cf commit 261f78d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions logspout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ By default, routes are ephemeral. But if you mount a volume to `/mnt/routes`, th

See [Routes Resource](#routes-resource) for all options.

#### Using a custom timestamp format

By default, logspout will use the timestamp format `2006-01-02T15:04:05MST`. A custom format can be specified by setting the `DATETIME_FORMAT` environment variable.

## HTTP API

### Streaming Endpoints
Expand Down
2 changes: 1 addition & 1 deletion logspout/logspout.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func syslogStreamer(target Target, types []string, logstream chan *Log) {
// HACK: Go's syslog package hardcodes the log format, so let's send our own message
_, err = fmt.Fprintf(conn,
"%s %s[%s]: %s",
time.Now().Format(dtime.DEIS_DATETIME_FORMAT),
time.Now().Format(getopt("DATETIME_FORMAT", dtime.DEIS_DATETIME_FORMAT)),
tag,
pid,
logline.Data)
Expand Down

0 comments on commit 261f78d

Please sign in to comment.