customize log format
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 178
- Avg merge
- 15d 9h
- Merged PRs (30d)
- 2
Description
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the rest-server command's existing --log output path and how its current access-log format is produced. Add the requested --logformat option with timestamp-style formatting, while preserving the existing request fields; done means logs can use the sortable example format and the current logging behavior remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100