Better Stack transport for the LogLayer logging library.
npm install @loglayer/transport-betterstack


Better Stack transport for the LogLayer logging library. This transport sends logs to Better Stack's log management platform using their HTTP API.
``bash`
npm install @loglayer/transport-betterstack
`bash`
yarn add @loglayer/transport-betterstack
`bash`
pnpm add @loglayer/transport-betterstack
- Create a "Javascript / Node.js" log source in your Better Stack account.
- In the "Data ingestion" tab of your source, find your source token and the ingesting host.https://
- Add in front of the ingesting host for the url parameter.
`typescript
import { LogLayer } from "loglayer";
import { BetterStackTransport } from "@loglayer/transport-betterstack";
const transport = new BetterStackTransport({
sourceToken: "
url: "https://
});
const log = new LogLayer({ transport });
log.info("Hello, Better Stack!");
log.withMetadata({ userId: "123" }).info("User logged in");
``
For detailed configuration options and advanced usage, see the Better Stack transport documentation.