Skip to content

Commit

Permalink
Add fields to example api route logs for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dasfmi committed Aug 6, 2024
1 parent a2a298e commit 9aa9eee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/logger/app/api/edge/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { AxiomRequest, withAxiom } from 'next-axiom';
export const runtime = 'edge';

export const GET = withAxiom(async (req: AxiomRequest) => {
req.log.info('fired from edge route');
req.log.info('fired from edge route', {
method: req.method,
author: 'Islam Sheata',
purpose: 'testing',
});
return new Response('Hello, Next.js!');
});
6 changes: 5 additions & 1 deletion examples/logger/app/api/lambda/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { AxiomRequest, withAxiom } from 'next-axiom';
export const runtime = 'nodejs';

export const GET = withAxiom(async (req: AxiomRequest) => {
req.log.info('axiom lambda route');
req.log.info('axiom lambda route', {
method: req.method,
author: 'Islam Sheata',
purpose: 'testing',
});
return new Response('Hello, Next.js!');
});

0 comments on commit 9aa9eee

Please sign in to comment.