Skip to content

Custom timestamp field #485

@apremalal

Description

@apremalal

I'm trying to customise the time stamp field as mentioned in the last comment of this thread.

#33

logger := zap.New(
  zap.NewJSONEncoder(zap.RFC3339Formatter("@timestamp")),
  zap.ErrorLevel,
  zap.Output(someFile),
)

But it seems the content is outdated already. I couldn't locate zap.RFC3339Formatter and zap.NewJSONEncoder is moved to zapcore.NewJSONEncoder. An example usage with the new API changes would be a great thing to have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions