Install any skill in seconds. Free to start, no credit card required.
Get Started Free →elie222/logging
How to do backend logging
Passed 22 of 24 test cases with the skill, and 7 of 24 without it.
and 19 more in the full report
15 fixed7 passed either way2 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 15 test cases the skill fixed. Same model, same prompt, with and without the skill.
When defining a standalone database utility function processOrder that needs to receive a logger from a Next.js route handler, where should the Logger type be imported from? Show the import statement and function signature.
| Checked | Without skill | With skill |
|---|---|---|
| The utility file imports Logger from @/utils/logger. | Missed | Passed |
The instructions your model reads when the skill loads.
We use a centralized, request-scoped logging pattern where loggers are created by middleware and passed through the request/function chain.
Use middleware wrappers that automatically create loggers with request context:
import { withError, withAuth, withEmailAccount, withEmailProvider } from "@/utils/middleware";
// Basic route with error handling and logging
export const POST = withError("my-route", async (request) => {
const logger = request.logger;
logger.info("Processing request");
// ...
});
// Authenticated route - logger includes userId
export const GET = withAuth("my-route", async (request) => {
request.logger.info("User action"); // Already has userId context
// ...
});
// Email account route - logger includes emailAccountId, email
export const POST = withEmailAccount("my-route", async (request) => {
request.logger.info("Email action"); // Has userId, emailAccountId, email
// ...
});
// Email provider route - same as email account, plus provides emailProvider
export const GET = withEmailProvider("my-route", async (request) => {
request.logger.info("Provider action");
const emails = await request.emailProvider.getMessages();
// ...
});
The middleware automatically adds:
requestId - Unique ID for request tracingtest cases passed, vs 7 / 24 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.