Any way to view pages logs?
I'm trying to debug MailChannels not working and can't get any sort of data to log at all.
I tried returning response objects from the SvelteKit actions and then logging them through "Real-time Logs", but those always return OK even when the status is 500, and they also don't include any of the response data that I try to attach.
Attached below is my latest request. (says OK even though it errors?)
20 Replies
If needed, here's my code:
There's more to the code but I cut out the irrelevant stuff. Maybe returning something from the actions could work?
The Ok status just means that a response was returned. It doesn't need to a be a 200 response
Oh, makes sense. How can I somehow log / return data about why the email send function failed?
I believe so, just it needs to be triggered by the email handler and not the on fetch handler
If doing something like console.log, can you view the output anywhere on cloudflare? If not, how else do I return info on why it failed? I tried returning data like this but it did not work:
I need some way of finding out what the response of emailCode is, but its not an actual endpoint so logs dont catch it
You should be able to do it in the workers logs, but unless you have a logpush enabled for the worker it won't be saved.
this is a pages app
I was not able to find any sort of pages logs through the CF dashboard
besides the request logger
That is the request logger where you can see it. If you are using
console.log
then those entries should appear in the request logger.Weird, the logged did not catch any console.log's before. Let me try re-adding them to test this again.
There's some reasons you may not want to use mailchannels:
https://discord.com/channels/595317990191398933/779390076219686943/1152689451374477483
But if you have no other option, I'd ask if you added the mailchannels lockdown txt to allow it to work?
Oh wow, you're right. idk how I didnt notice this before
Thanks for this
I did add lockdown
let me read the attached message
what lockdown txt record did you add?
With Pages it should be like
_mailchannels TXT v=mc1 cfid=xxxxx.pages.dev
where xxxx is your pages project.dev, like
_mailchannels TXT v=mc1 cfid=quick-test.pages.dev
yeah I read somewhere to add xx.pages.dev, still did not work
I've tried a lot of thing to get mailchannels to work and it just does not want to work. I might honestly just use amazon SES. The security issues you linked to are also troublesome
Why do you have mutiple cfids? I don't see that mentioned as being supported in any of their examples/docs
I've tried just doing one cfid with my .pages.dev, still had the same result
it's not a bad idea to just use something else, but otherwise I'd log the response text and see what the api is responding with
Alright, I'll try to fix mailchannels just to track down the issue and then probably switch after that, appreciate all the help 🙏