---
title: "SolidStart"
description: "Attach Blyp with createMiddleware(), use event.locals.blypLog or getRequestEvent()?.locals.blypLog, and mount clientLogHandler in a route."
canonical_url: "https://www.blyp.dev/docs/integrations/solid-start"
markdown_url: "https://www.blyp.dev/docs/integrations/solid-start.md"
last_updated: "2018-10-20"
x_farming_labs_generated_preamble: true
---

# SolidStart
URL: /docs/integrations/solid-start
LLM index: /llms.txt
Description: Attach Blyp with createMiddleware(), use event.locals.blypLog or getRequestEvent()?.locals.blypLog, and mount clientLogHandler in a route.

# SolidStart

Import from `@blyp/core/solid-start`. The `createLogger()` export is an alias of `createSolidStartLogger()`.

```ts
import { createMiddleware } from "@solidjs/start/middleware";
import { createLogger } from "@blyp/core/solid-start";

const solidLogger = createLogger({
  level: "info",
});

export default createMiddleware(solidLogger.middleware);
```

## Accessing the logger

```ts
export async function GET(event: {
  locals: { blypLog?: { info: (message: string) => void } };
}) {
  event.locals.blypLog?.info("solidstart-route");
  return new Response("ok");
}
```

```ts
import { getRequestEvent } from "solid-js/web";

getRequestEvent()?.locals.blypLog?.info("solidstart-server");
```

Use `event.locals.blypLog` inside middleware and route handlers, and `getRequestEvent()?.locals.blypLog` elsewhere on the server when no event object is in scope.

## Client ingestion route

```ts
// src/routes/inngest.ts
import { createLogger } from "@blyp/core/solid-start";

const solidLogger = createLogger();

export const POST = solidLogger.clientLogHandler;
```

The mounted route path must match `clientLogging.path`, otherwise Blyp returns a `500` mismatch response.

## What auto-logged requests look like

With automatic request logging enabled, Blyp emits terminal output like:

```text
[INFO]  GET  /health        200  2ms
[INFO]  POST /checkout      200  143ms
[INFO]  GET  /users/42      404  8ms
[ERROR] POST /payments      500  1203ms
```

Fields included automatically: method, path, status code, and duration.

**In production (NDJSON):**

```json
{"level":"info","time":1710000000000,"msg":"GET /health","type":"http_request","method":"GET","url":"/health","statusCode":200,"responseTime":2}
{"level":"info","time":1710000000001,"msg":"POST /checkout","type":"http_request","method":"POST","url":"/checkout","statusCode":200,"responseTime":143}
```

## Relevant types

```ts
import type {
  SolidStartLoggerConfig,
  SolidStartLoggerFactory,
  SolidStartFetchEvent,
  SolidStartAPIEvent,
  SolidStartLocals,
} from "@blyp/core/solid-start";
```

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
