1.1.9 • Published 7 months ago

log-to-route v1.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Log-to-route (l2r)

l2r.config.json

Create an l2r.config.json file in the root of your app and add the following:

{
  "logFile": {
    "format": "styled",
    "enabled": true,
    "fileName": "app.log",
    "location": "./",
    "timeType": "epoch",
    "colorizeStyledLog": false
  },
  "console": {
    "format": "styled",
    "enabled": true,
    "timeType": "locale",
    "colorizeStyledLog": true
  }
}

Usage

import { logger } from 'log-2-route'

logger.info("Log message");

Config Options

Coming...

Log Router

To route logs to a specific endpoint, add a /app/logger/route.ts to your project. The route.ts should contain:

import { LogReceiver } from "log-to-route";

export async function POST(req: Request) {
  const res = await LogReceiver(req);
  return new Response(await res.text(), { status: res.status });
}
1.1.9

7 months ago

1.1.8

7 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago