next-axiom icon indicating copy to clipboard operation
next-axiom copied to clipboard

Log drains or the HTTP logger

Open kostas-pblworks opened this issue 5 months ago • 3 comments

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?

kostas-pblworks avatar Mar 14 '24 09:03 kostas-pblworks

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 avatar Mar 21 '24 14:03 schehata

@schehata cant these text lines from the log drain be stringified JSON and then just parse them on Axiom side?

kostas-pblworks avatar Mar 21 '24 16:03 kostas-pblworks

@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.

bahlo avatar Mar 26 '24 12:03 bahlo