You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the next-axiom library for Next.js and I'm trying to understand why does log.flush() needs to be called before returning on server components?
It will be great to know a little bit more about this function to really understand when to use it, that's what I'm proposing here, cause until know the docs of this library does not tell anything about that function, they only present a single use case out of 20 of more posible use cases.
Maybe you want to create a function that process errors and one of the tasks of that function is sending the error info to an Axiom dataset, so does that function will need to call log.flush() internally? What if I call this function multiple times on the server components? Does calling log.flush() multiple times will cause unwanted behavior?
Maybe you want to ingest data from middleware.ts, generateMetadata or any other context that is executed on the server, but that is not a server component, what do I do in those cases?
Do I need to call log.flush before throwing also?
It will be great to have this specified on the docs, thank you so much!
The text was updated successfully, but these errors were encountered:
I'm using the
next-axiom
library for Next.js and I'm trying to understand why doeslog.flush()
needs to be called before returning on server components?It will be great to know a little bit more about this function to really understand when to use it, that's what I'm proposing here, cause until know the docs of this library does not tell anything about that function, they only present a single use case out of 20 of more posible use cases.
Maybe you want to create a function that process errors and one of the tasks of that function is sending the error info to an Axiom dataset, so does that function will need to call
log.flush()
internally? What if I call this function multiple times on the server components? Does callinglog.flush()
multiple times will cause unwanted behavior?Maybe you want to ingest data from
middleware.ts
,generateMetadata
or any other context that is executed on the server, but that is not a server component, what do I do in those cases?Do I need to call
log.flush
before throwing also?It will be great to have this specified on the docs, thank you so much!
The text was updated successfully, but these errors were encountered: