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
This researches the different ways to improve the package's configuration, allowing the user to make use of different transports for example, in the same app.
Configuration
should be able to import helper functions from axiom kit
constlog=newLogger(VercelConfig())constVercelConfig=(override)=>{// get url and token from integration envconsturl=process.env.NEXT_PUBLIC_AXIOM_INGEST_URL;consttoken=process.env.NEXT_PUBLIC_AXIOM_TOKEN;constdataset="vercel";if(isBrowser){return{transport: newFetchTransport({ token, dataset })}}elseif(isEdge||isNode){return{transport: newConsoleTransport()}}}
The ConsoleTransport would be a great choice for apps that have vercel or netlify integration because then functions can just log every thing to the console without waiting for fetch to finish. This would save time and avoid errors on edge and lambda functions.
The downside is the console log limit per platform, for example, vercel's 4kb limit. maybe the ConsoleTransport could have a fallback method, to queue to fetch. or vice-verse, the Fetch transport would queue stuff, but if its below the limit and integration is active, then it just prints to console instead of queuing.
The text was updated successfully, but these errors were encountered:
next-axiom advanced configuration support
This researches the different ways to improve the package's configuration, allowing the user to make use of different transports for example, in the same app.
Configuration
passing a logger to route handlers:
ConsoleTransport
The ConsoleTransport would be a great choice for apps that have vercel or netlify integration because then functions can just log every thing to the console without waiting for fetch to finish. This would save time and avoid errors on edge and lambda functions.
The downside is the console log limit per platform, for example, vercel's 4kb limit. maybe the ConsoleTransport could have a fallback method, to queue to fetch. or vice-verse, the Fetch transport would queue stuff, but if its below the limit and integration is active, then it just prints to console instead of queuing.
The text was updated successfully, but these errors were encountered: