You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logger shows an error 500 whenever `error` is used, no matter what status code is supplied to the method, likewise it will show a status 200 on a get method even when forcibly returning an error.
When testing, I can arbitrarily set any status code I want and whilst my test client (Insomnia in this instance) shows the status code I set, the console logger will always show it as error 500.
Steps to Reproduce
Create an Elysia instance and use the logger with the following options:
.use(logixlysia({
config: {
showStartupMessage: true,
startupMessageFormat: 'banner',
timestamp: {
translateTime: 'dd-mm-yyyy HH:MM:ss',
},
ip: true,
customLogFormat: '🦊 {now} {level} {duration} {method} {pathname} {status} {message} {ip}'
}
}))
Then add a GET method to any path and have it return an error with any status code desired. The logger will always show status 200, even when a client like Insomnia or Postman will show the actual status code.
### Expected Behavior
```Markdown
The status code on the logger to be consistent with the status code being set in the response.
Actual Behavior
As stated above.
Additional Information
No response
Reproduction Repository
No response
The text was updated successfully, but these errors were encountered:
I'm going down a rabbit hole now and discovering that there is far too many ways of triggering incorrect status messages on the logger.
I went so far as to go back to version 3.0.1 where a change was made specifically because of "wrong status code" (#33) and am still seeing the same issue. I guess the real question is 'how does the logger determine what status code to offer on the log line' because it seems completely disconnected from what is actually being set in the response.
Sorry for the slow response, I've been having a lot of fun making my personal website 🥹
I've used StatusMap from Elysia.js. Now supports both numeric status codes (e.g. 429) and status messages (e.g. "Too Many Requests"). Let me know if you need any adjustments.
Latest Version Checked
Platform
Linux 🐧
Priority
Low 💤
Screenshots
No response
Description
Steps to Reproduce
Then add a GET method to any path and have it return an error with any status code desired. The logger will always show status 200, even when a client like Insomnia or Postman will show the actual status code.
Actual Behavior
Additional Information
No response
Reproduction Repository
No response
The text was updated successfully, but these errors were encountered: