next-axiom
next-axiom copied to clipboard
Log drains or the HTTP logger
All of your documentations points to first installing the integration with Vercel which uses the Log Drains to ingest logs from Vercel directly to Axiom, but then the logger that this library exports uses the Axiom HTTP API directly to send logs to Axiom.
I understand that frontend may need to use the HTTP API but on the server is totally not necessary.
Was that intentional? Are there plans to change this behaviour?
hi @kostas-pblworks , currently you can use console.log()
and the logdrain to ship logs to Axiom, but they will be sent as text lines. If you want to send structured logs, you would have to use next-axiom or one of your SDKs.
There is one idea to make next-axiom using console.log behind the scenes if the logdrain is enabled, and then parse it on Axiom side when recognized as JSON.
@schehata cant these text lines from the log drain be stringified JSON and then just parse them on Axiom side?
@kostas-pblworks we do have an internal issue to detect and parse json payloads (INP-57). will let you know when this is on production. please note that right now the next-axiom logs are enriched with request data that you'll be missing with console.log, unless you add it yourself.