Skip to content

Question around log formatting #1581

@eklein

Description

@eklein

I am looking at trying to add one or two additional fields to the standard LoggerWithWriter() output.

Example before:

[GIN] 2018/09/26 - 23:30:55 | 204 | 9.908935ms | 10.10.10.1 | DELETE /uri/path

Example of what I'd like to add after:

[GIN] 2018/09/26 - 23:30:55 | 204 | 9.908935ms | 10.52.161.250 | <username or payload information> | DELETE /uri/path

I haven't found a ton of resources in terms of folks overriding this default logger. I see quite a few instances where folks add some middleware to output extra data in addition to this standard logging, but I'd love to see if there's a way to augment the existing log line with additional data.

Thanks in advance for any assistance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions