Application Log Viewer
A terminal-style application log viewer section: a dark monospace panel styled like a terminal window shows structured log lines, each with a colored level tag, a timestamp, a source/module label, and the message. A row of level filters above the panel narrows the visible lines to a single severity, or back to all of them. Built for status pages, docs, and internal observability dashboards.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/application-log-viewer.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/devtools/devtools15.tsx instead.
Usage
The file also exports devtools15Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Devtools15, devtools15Demo } from "@/components/blocks/devtools/devtools15"; export default function Page() { return <Devtools15 {...devtools15Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Application log viewer" | Section heading. |
| description | string | undefined | Section intro text below the heading. |
| windowTitle | string | "app.log" | Filename label shown in the terminal window's title bar. |
| lines | LogLine[] | [] | Log lines, in the order they should render (top to bottom). |
| className | string | none | Extra classes for the outer section element. |
Types
type LogLevel = "INFO" | "WARN" | "ERROR" | "DEBUG"; type LogLine = { id: string; level: LogLevel; timestamp: string; source: string; message: string; };
Behavior notes
- The level filter row is genuinely functional ("use client" with real useState): clicking a level shows only lines at that level, or all lines for "All". Filtering happens entirely against the lines already passed in; there is no live tailing or streaming.
- Level tag color is fixed by level value (INFO=sky, WARN=amber, ERROR=red, DEBUG=neutral/muted) and is not configurable per-line beyond changing level.
- The dark terminal panel is a deliberate exception to the site's semantic color tokens, matching the repo's established terminal-window convention, and stays dark regardless of site theme.
- The log panel scrolls internally (max-h-[520px] with overflow-y-auto) once lines exceed the visible height, rather than growing the section indefinitely.
- When a filter has no matching lines, the panel renders a single "# no log lines match this filter" placeholder line instead of an empty panel.
- timestamp is a plain display string with no date component in the demo data (just a clock time), and is not derived from a real Date.
More DevTools Blocks
View all →api-endpoints-sample-call
API Endpoints With Sample Call
Reference list of API endpoints paired with a live sample request and response panel.
cicd-pipeline-status
CI/CD Pipeline Status
Recent CI/CD pipeline runs with per-stage status chips and overall run badges.
code-diff-viewer
Code Diff Viewer
Unified code diff panel with a file header change summary and colored addition/deletion lines.
keyboard-shortcuts-reference
Keyboard Shortcuts Reference
Grouped keyboard shortcut reference with keycap-styled key combos.
performance-waterfall
Performance Waterfall
Network request waterfall chart with cascading timing bars colored by duration.
service-health-board
Service Health Board
Infrastructure status board with a live summary strip and per-service uptime, latency, and health.