Custom message in Vercel logs
Unanswered
American black bear posted this in #help-forum
American black bearOP
Is it possible to have custom messages in logs that are seen in Vercel? I'm trying to check the value of something in my serverless function but it seems like I can only see the HTTP status code in my Vercel logs.
I'm trying to see the value that is being passed for
Update: I should add that I'm using TypeScript I've tried using console.log (warn, error, etc).
I'm trying to see the value that is being passed for
req.headers.authorization because I'm attempting to pass an auth token to the endpoint but it doesn't seem to be receiving it the way I'm expecting.Update: I should add that I'm using TypeScript I've tried using console.log (warn, error, etc).
6 Replies
@American black bear Is it possible to have custom messages in logs that are seen in Vercel? I'm trying to check the value of something in my serverless function but it seems like I can only see the HTTP status code in my Vercel logs.
I'm trying to see the value that is being passed for `req.headers.authorization` because I'm attempting to pass an auth token to the endpoint but it doesn't seem to be receiving it the way I'm expecting.
Update: I should add that I'm using TypeScript I've tried using console.log (warn, error, etc).
You can allow certain console logs (like .warn .log or .error) to appear in deployment logs in the next.config.js
const nextConfig = {
compiler: {
removeConsole: {
exclude: ['info', 'error']
}
}
}American black bearOP
Amazing, thank you!
You have to click on them and see the details
Hmm maybe its differently configured in the middleware....