How do I turn off console logs for server functions?
Is there a setting somewhere in
app.config.ts
? I couldn't find anything in the documentation6 Replies
fascinating-indigo•11mo ago
I really wanna know this too, I started a post on it today too, but accidentally in the query channel
Please ping me if you find out
fascinating-indigo•11mo ago
I tracked down where these logs are coming from in the TanStack router here and are not configurable https://github.com/TanStack/router/blob/8e4d1645c23678aae486674b7dda4ef2e130d0a9/packages/start/src/server-handler/index.tsx#L170
Anyway, I found a workaround. Add this to your
ssr.tsx
at the very top (before imports):
This will filter out all ServerFn logs, Payload messages and empty lines, keeping your console clean during developmentGitHub
router/packages/start/src/server-handler/index.tsx at 8e4d1645c2367...
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
like-goldOP•11mo ago
thanks! @Sajmon will wait for an official solution though, it's just a bit annoying during dev but not intolerable
fascinating-indigo•11mo ago
Yeah, for me it was a little bit more annoying because i have my own logging utility and it is bad when they are mixing together


wise-white•11mo ago
I've took the chance to start contributing and opened a PR for it 😁
https://github.com/TanStack/router/pull/2719
GitHub
start: allow disabling server functions logs by kandros · Pull Requ...
Allow disabling serverFn logs in development as requested in https://discord.com/channels/719702312431386674/1304470693970444318
foreign-sapphire•7mo ago
Any update on this?