Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customize log format #283

Open
Framsfex opened this issue May 10, 2024 · 0 comments
Open

customize log format #283

Framsfex opened this issue May 10, 2024 · 0 comments

Comments

@Framsfex
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant