---
title: "Log"
description: "What a process printed, line by line."
group: "Content"
order: 4
---

What a process printed, line by line.

Styles: `components/card.css`, `components/log.css`.

```html
<div class="moin-card">
  <div class="moin-log" tabindex="0" aria-label="Deploy log">
    <div data-kind="step">
      <span>Cloning 8c41f2a</span>
    </div>
    <div data-kind="out">
      <span>Building the image</span>
    </div>
    <div data-kind="out">
      <span>Starting my-app</span>
    </div>
    <div data-kind="err">
      <span>Port 8080 did not answer</span>
    </div>
    <div data-kind="ok">
      <span>Live on web-1</span>
    </div>
  </div>
</div>
```

Each `div` is a line, `data-kind` says what kind (`out`, `step`, `ok`, `err`),
`data-n` sets its number and `data-dim` makes a part of it quieter. A `details`
with lines right in it folds them under its `summary`. With `data-meta` on the
log, each line has two more columns in front of the text, like a time and a
service.

## Tail

`moin-tail` keeps the newest line in view while you are at the bottom, and stays put when you scroll up. It holds a `moin-log`. `--tail` is how high it grows.

- `data-top` keeps few lines at the top.
- `data-hold` keeps the place of lines still to come.
- `data-tall` holds a height on a large screen.

```html
<div class="moin-card" data-flush>
  <div class="moin-tail" data-top style="--tail:8rem" tabindex="0" aria-label="Logs">
    <div class="moin-log">
      <div data-kind="out"><span>GET / 200</span></div>
      <div data-kind="out"><span>GET /health 200</span></div>
      <div data-kind="out"><span>POST /deploy 202</span></div>
    </div>
  </div>
</div>
```

## Plain output

A `pre` with `moin-log` holds output in one piece. It keeps its own line breaks and wraps long lines.

```html
<div class="moin-card" data-flush>
  <pre class="moin-log moin-inset">Plain output keeps its line breaks.
A long line wraps instead of pushing the box wider.</pre>
</div>
```
