Logging in the console
Hey folks, moving the discussion here to avoid spamming general.
What's the easiest path logging HTTP requests emitted by Mastra agents? As a default the playground would log traces but the LLM call seems tied to a "getMostRecentUserMessage" event which only shows the model message, not the full HTTP request. A log drain should work but I don't see docs for a console drain, and as a default on a new app I don't see logs in the console. The default recommended logger is Pino which I think will stick to outputting JSON data and not HTTP requests. The lack of HTTP logging is the #1 pain point I feel when using anything that wraps HTTP requests (looking at n8n namely ๐ฌ huge pain to debug) and I'd be eager to get rid of this issue in Mastra's context.
Using mastra@latest (11.0.3 alpha) the log drain is not recognized despite Pino being set up. What is the expected behaviour, having logs in the console ?
5 Replies
Hey @Eric Burel ! By default, on a fresh project, logs go the console. You can change the log level to debug, but it still won't show the actual HTTP request in the console. I don't know if ai-sdk providers allow for this low level debug ๐ค
Yeah so I think that could be a bug with the version I use, I remember seeing more logs than that indeed, will dig
If they don't display enough info I may give a shot at contributing to vercel ai sdk
For instance in Langchain I had an issue with Mistral connector (bad chunking for embeddings computation leading to an opaque 4xx error) and the lack of logging is super annoying. Python let's you enable logs in nested packages including http so it helps a bit at least.
With Chroma same thing, there's an http request that fails to download a model and it's again tricky to debug.
I even planned to install wireshark to track all http requests on my machine but it's not really turnkey
๐ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/7463
GitHub
[DISCORD:1412831612957102211] Logging in the console ยท Issue #7463...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1412831612957102211 Hey folks, moving the discussion here to avoid spamming general. What's the easies...
hi @Eric Burel Could you let me know more about how you are running your mastra system? Are you running it directly, or inside another tool?
Do you desire this logging mostly in the playground environment or in production as well?
If you could respond in the issue linked above, that would be great.
Hi @Eric running directly on Ubuntu, in a playground environment indeed