Disable server access log

How can I disable server access logs when running in docker container? I would like to have them when running with wasp start
10 Replies
kapa.ai
kapa.ai2mo ago
Hi @Jarko Sunce | Calimero. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources do not contain information on how to disable server access logs specifically when running a Wasp app in a Docker container. There is no mention of a configuration option or environment variable for toggling server access logs between development (wasp start) and production (Docker) modes. If you need more control over logging, you might consider customizing the server code or the Dockerfile, but the official documentation and community discussions do not provide explicit instructions for this scenario. If you have a custom Dockerfile, you may want to check the generated one for possible logging configurations, as suggested during migration steps, but again, no direct solution is documented for disabling access logs specifically in Docker deployments Default Server Dockerfile Changed. For now, you may need to explore this by inspecting the server code or by reaching out to the Wasp community for further guidance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Jarko Sunce | Calimero, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Jarko Sunce | Calimero
And can I disable server access logs in general?
Carlos
Carlos2mo ago
i'll ask the bot while i investigate @kapa.ai is it possible to disable server access logs?
kapa.ai
kapa.ai2mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I'm sorry, but the knowledge sources do not contain any information about disabling server access logs in a Wasp app. There is no mention of a configuration option, environment variable, or code change that would allow you to disable server access logs. If this feature is important for your use case, you may want to open a feature request or ask the Wasp community for further guidance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Carlos, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Carlos
Carlos2mo ago
@Jarko Sunce | Calimero which logs are you referring to btw? and also why do you want to remove them?
Jarko Sunce | Calimero
Server access logs are showing what clients access on server. It becomes super noisy when you are running in some orchestrator which performs health checks. It looks like this GET / 200 0.093 ms - - GET / 200 0.227 ms - - GET / 200 0.095 ms - - GET / 200 0.144 ms - - GET / 200 0.135 ms - - GET / 200 0.094 ms - - GET / 200 0.186 ms - - GET / 200 0.100 ms - - GET / 200 0.092 ms - - GET / 200 0.095 ms - - GET / 200 0.184 ms - -
Carlos
Carlos2mo ago
We do this logging through a middleware, and this is open for customization: https://wasp.sh/docs/advanced/middleware-config
Configuring Middleware | Wasp
Wasp comes with a minimal set of useful Express middleware in every application. While this is good for most users, we realize some may wish to add, modify, or remove some of these choices both globally, or on a per-api/path basis.
Carlos
Carlos2mo ago
You can add a middleware customization function and do
middlewareConfig.delete('logger')
middlewareConfig.delete('logger')
is that useful?
Jarko Sunce | Calimero
Looks promising, I will give it a go on Monday and will let you know. Thanks.
MEE6
MEE62mo ago
Wohooo @Jarko Sunce | Calimero, you just became a Waspeteer level 1!

Did you find this page helpful?