-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axiom is not formatting my logs properly #179
Comments
how does the log record for |
Locally the |
+1 I'm also seeing this same behaviour of a log being split into individual log entries. I'm using Axiom as a Vercel integration with NextJS and logging within a server action (preview deployment). Here's basically how I'm using it:
Versions:
Have also followed the steps to wrap the Next.js config with |
@schehata Are there any updates here? I haven't changed anything on my project and it was working previously but now the logs are largely useless as I can't pull any information from them at all. |
hi @YourAverageTechBro , unfortunately I am not able to reproduce, I check our apps that uses the same version. maybe if you can provide a repo that reproduces this I could be able to debug and find out whats going on. |
Hi @testerez , thats insightful, I will use your test to reproduce and debug whats going on. |
Was there any progress made here? I'm experiencing this as well. Also, since Server Actions are just mini api routes, can Regular Axiom logging doesn't seem to work from Server Actions (for me at least) when NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT is set for that Vercel environment. When I instantiate the logger, the config object shows the Is that correct? Once I removed that env var from the Preview environment, the config URL changed to the default Axiom ingest and the logs started showing up properly. Here's what I have in one of my server actions and nothing ever appears via the Vercel log drain. If I use I would guess that the web-vitals endpoint is not expecting to see log type messages and they're getting dropped. Is that the case? "use server";
import { inngest } from "./client";
import { Logger } from "next-axiom";
// Sending events to Inngest should always be from a server action. The EVENT_KEY is typically not NEXT_PUBLIC.
export async function inngestSendEvent(event:any) {
const log = new Logger();
log.warn('[inngestSendEvent] starting');
log.warn('[inngestSendEvent] called with:', event);
let resp;
try {
resp = await inngest.send(event);
} catch (e) {
resp = e;
}
log.warn('[inngestSendEvent] finishing.');
log.flush();
return JSON.stringify(resp);
} |
Hey @schehata, did you get a chance to test this? This issue may be a deal breaker at some point for us... |
I've been experiencing this too. I was using Axiom lots over the past few days to look at the logs for an app then I deployed a fairly minor code change today (completely unrelated to the logging setup) and now the Axiom logs are now split to single lines. I'd done multiple deploys throughout the past couple of days with without any problems with the logs. It just broke for no obvious reason with the last one. 🤷 |
Our logs are now working properly again without making any changes at all (no code deploys or configuration changes — I literally went to bed and looked at it again in the morning and it was fixed)! I can see the logs started getting formatted correctly again at a seemingly arbitrary point in time. The last incorrectly formatted log happens to be a |
This is still happening intermittently for us. Definitely seems more common immediately after a deploy. |
Just want to pile on, having the same issues here. Printing an object results in each line of the object being a separate item in Axiom. It is pretty much unusable. |
We were able to reproduce and we are working on a fix. Just wanted to note that this is not related to |
was there ever a fix? |
I have a nextjs project on vercel using axiom for logging.
On the logs tab in Vercel, my log is being properly formatted like so:
but if you look at the attached image you can see that each field in the JSON is being split up into its own individual log message.
I am calling the
log.info
like so:Am I doing something wrong? i would ideally want each field to be a part of the properties that are logged with the top level message of
Starting endpoint
The text was updated successfully, but these errors were encountered: