Skip to content

customize log format #283

@Framsfex

Description

@Framsfex

Output of rest-server --version

rest-server version rest-server 0.12.1 compiled with go1.20.5 on linux/386

What should rest-server do differently?

Add an option --logformat

What are you trying to do? What is your use case?

The log file has entries of this format:

129.69.202.138 - - [10/May/2024:09:38:26 +0200] "HEAD /test/config HTTP/2.0" 200 0 "" "Go-http-client/2.0"

But I prefer:

[2024-05-10 09:38:26] 129.69.202.138 - - "HEAD /test/config HTTP/2.0" 200 0 "" "Go-http-client/2.0"

Because it is easy sortable.

So, a new option like this would be great:

--logformat "[%Y-%m-%d %H:%M:%S] ..."

My workaround so far is:

rest-server $OTHER_OPTIONS --log - | perl_log_converter >> $DATA/log

Did rest-server help you today? Did it make you happy in any way?

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