> This page is for version 1.4.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 1.4.0 (Latest) (default): https://docs.nvidia.com/halos/outside-in-safety/1.4.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/halos/outside-in-safety/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/halos/outside-in-safety/_mcp/server.

# Log Viewer

> Use pss_log_viewer, a browser dashboard that tails and filters up to two Safety Core log files.

Log Viewer provides a browser-based dashboard for real-time analysis of Safety Core logs. It is
packaged as a self-contained binary with all runtime dependencies included.

## Overview

Log Viewer streams Safety Core logs to a browser-based dashboard. It auto-detects components,
parses multiple log formats, and reflects new log entries in near real-time.

| **Property**  | **Details**                                                 |
| ------------- | ----------------------------------------------------------- |
| Deployment    | Self-contained binary with all runtime dependencies bundled |
| Live updates  | Near real-time via Linux inotify                            |
| Max log files | Up to 2 files merged into one dashboard                     |
| Default port  | 8080 (configurable via `--port`)                            |

## Features

* **Dashboard** — per-component tabs with stats, error counts, and timeline charts.
* **Filtering** — severity, free-text search, and timestamp range filters per tab.
* **Live tailing** — new log entries are reflected in near real-time with smart auto-scroll.
* **Export** — HTML, PDF, Excel, and CSV; respects active filters.
* **AI Debug** — ask natural-language questions against the live log state; export chat as HTML/PDF.

## Launching the tool

> **Note**
>
> `pss_log_viewer` is distributed separately and is not part of the Safety Core Debian packages
> or the Safety Core container image. The commands below assume you have already obtained the
> binary and are running it from its own directory.

The Safety Core writes its logs under `/var/log/psf/`. Which file holds which component is
listed in [Launchers and command-line options](/halos/outside-in-safety/reference/launcher#logs). In a Docker
deployment the SEI daemon, the NvPSD Gateway and the MDX client log to `psf.log`; with
`--runtime host` and the package's rsyslog rule installed, their records go to `pss.log`.

```bash
# Single log file (default port 8080)
./pss_log_viewer /var/log/psf/psf.log

# Two log files merged
./pss_log_viewer /var/log/psf/psf.log /var/log/psf/atl_sdm.log

# Custom port
./pss_log_viewer /var/log/psf/psf.log --port 9090

# Large files: load only the last N lines on startup
./pss_log_viewer /var/log/psf/psf.log --last 50000
```

The tool prints the full network URL on startup, for example `http://192.0.2.10:8080`. Open it
from any browser on the same network.

## Launching with AI Debug

The AI Debug tab is an optional feature that enables natural-language querying of the live
log state. It supports any LLM inference endpoint that implements the standard Chat
Completions API, giving users the flexibility to connect their preferred model and service.

Set the following environment variables before launching:

```bash
export PSS_AI_BASE_URL=<your-llm-endpoint-url>
export PSS_AI_MODEL=<your-model-name>
export PSS_AI_API_KEY=<your-api-key>
./pss_log_viewer /var/log/psf/psf.log
```

> **Note**
>
> All other dashboard features — log viewing, filtering, and export — are available
> without configuring the AI Debug tab.

## CLI reference

```text
Usage: pss_log_viewer [logfile1] [logfile2] [options]

Positional Arguments:
  logfiles          Path(s) to log file(s). Up to 2 files supported.

Options:
  --port, -p        Dashboard port (default: 8080)
  --last, -n        Read only last N lines on startup
  -h, --help        Show this help message

Environment Variables:
  PSS_AI_API_KEY    LLM API key — required for AI debug tab
  PSS_AI_BASE_URL   LLM endpoint URL
  PSS_AI_MODEL      LLM model name
```