Skip to content

Add custom configurable separator for console logger before start of the message. #1427

Open
@s3rj1k

Description

Describe the solution you'd like
It would be nice to have custom configurable separator for console logger before start of the message similar to how now is general separator is configured, so that log lines can be configured as follows:

2024-04-07T12:39:51Z	INFO	local/main.go:19	Server is running	{"addr": ":8080"}

vs

2024-04-07T12:39:51Z	INFO	local/main.go:19]	Server is running	{"addr": ":8080"}

Basically adding ]<TAB> (configurable opt-in) as delimiter between start of message and all other default fields.

Describe alternatives you've considered
Alternative would be to implement custom console_encoder but it feels like an overkill for adding single additional opt-in delimiter.

Is this a breaking change?
Change is backwards compatible, just adds new field in EncoderConfig that will only be processed by console encoder with the default value of ConsoleSeparator field. (New field can be named ConsoleMessageWithFieldsSeparator)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions