Log Viewer
Explore large logs with variable-height virtual scrolling and sticky tabular attributes.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
tabular | boolean | true | Align attributes vertically in columns; false displays concatenated entry text. |
wrap | boolean | false | Break text to fit the available column or viewport width. |
find-shortcut | boolean | true | Open the find bar on Ctrl/Command+F while focus is inside the viewer. false leaves the shortcut to the page. |
Events
| Name | Type | Description |
|---|---|---|
entry-activate | CustomEvent<LogViewerEntryEventDetail> | Fired when Enter is pressed on the active entry, with the same detail as entry-click. Bubbles. |
entry-click | CustomEvent<LogViewerEntryEventDetail> | Fired when an entry is clicked, except on its copy button or at the end of a drag or text selection. Bubbles. |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
token | Colored log token; severity and timestamp tokens use the existing level and timestamp colors |
copy-icon | Copy and success SVG icon |
copy-button | Copy the complete message of a visible entry; revealed on hover, tap or keyboard focus |
highlight | Matching visible entry or plain text slice in highlight mode |
active | The active entry (tabular) or its plain text slice |
find-bar | The find bar, built from c2-search-field and c2-icon-button |
find-match | A find match in the text; the current one also has the current part |
current | The current find match, or its tick on the ruler |
ruler | Find match ticks along the right edge |
viewport | Keyboard accessible scroll surface: a tree grid of entries with an active entry |
content | Virtual content and its total scroll extent |
entry | Visible tabular entry |
cell | Attribute column containing its sticky text |
text | Plain text content |
empty | Empty state |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-log-viewer--height | CSS value | 480px | Viewport height |
--c2-log-viewer--background | color | #0b1220 | Terminal surface |
--c2-log-viewer--color | color | #d3deee | Text color |
--c2-log-viewer--font-family | CSS value | ui-monospace, monospace | Text font |
--c2-log-viewer--font-size | CSS value | 13px | Text size |
--c2-log-viewer--line-height | CSS value | 1.65 | Line spacing |
--c2-log-viewer--border | CSS value | 1px solid #263449 | Outer edge |
--c2-log-viewer--border-radius | CSS value | 12px | Outer corners |
--c2-log-viewer__message--min-width | CSS value | 240px | Minimum primary column width |
--c2-log-viewer__cell--padding | CSS value | 8px 12px | Attribute cell inset included in row measurements |
--c2-log-viewer__text--inset | CSS value | 12px | Horizontal inset for continuous text |
--c2-log-viewer__empty--padding | CSS value | 24px | Empty state inset |
--c2-log-viewer__empty--color | color | #94a3b8 | Empty state text |
--c2-log-viewer__viewport__focus--outline | CSS value | 2px solid #60a5fa | Keyboard focus indicator |
--c2-log-viewer__timestamp--color | color | #94a3b8 | Timestamp text |
--c2-log-viewer__attribute--color | color | #a5b4cc | Secondary attribute text |
--c2-log-viewer__level--color | color | #c4b5fd | Unclassified level text |
--c2-log-viewer__level__info--color | color | #6ee7b7 | Info level text |
--c2-log-viewer__level__warning--color | color | #fcd34d | Warn and warning level text |
--c2-log-viewer__level__error--color | color | #fda4af | Error and fatal level text |
--c2-log-viewer__entry--box-shadow | CSS value | inset 0 -1px 0 #1b293d | Subtle row divider without changing measured geometry |
--c2-log-viewer__entry__hover--background | color | #142238 | Hovered row surface |
--c2-log-viewer__entry__highlighted--background | color | #17304c | Matching entry surface in highlight mode |
--c2-log-viewer__entry__highlighted--box-shadow | CSS value | inset 3px 0 0 #60a5fa | Matching entry accent without changing measured geometry |
--c2-log-viewer__entry__active--background | color | #1b2d47 | Active entry surface |
--c2-log-viewer__entry__active--box-shadow | CSS value | inset 0 0 0 1px #60a5fa | Active entry ring while the viewport has keyboard focus, without changing measured geometry |
--c2-log-viewer__find-match--background | color | rgba(250, 204, 21, 0.26) | Find match surface |
--c2-log-viewer__find-match--color | color | #fef3c7 | Find match text |
--c2-log-viewer__find-match__current--background | color | #fbbf24 | Current find match surface |
--c2-log-viewer__find-match__current--color | color | #1c1300 | Current find match text |
--c2-log-viewer__find--inset | CSS value | 8px | Find bar offset from the top and right edges |
--c2-log-viewer__find--padding | CSS value | 6px | Find bar inset |
--c2-log-viewer__find--gap | CSS value | 4px | Space between the find bar controls |
--c2-log-viewer__find--background | color | #142238 | Find bar surface |
--c2-log-viewer__find--border | CSS value | 1px solid #2c4366 | Find bar edge |
--c2-log-viewer__find--border-radius | CSS value | 8px | Find bar corners |
--c2-log-viewer__find--box-shadow | CSS value | 0 8px 24px rgba(0, 0, 0, 0.45) | Find bar elevation |
--c2-log-viewer__find--font-family | CSS value | system-ui, sans-serif | Find bar text font |
--c2-log-viewer__find--font-size | CSS value | 12px | Find counter text size |
--c2-log-viewer__find--color | color | #a5b4cc | Find counter text |
--c2-log-viewer__find__empty--color | color | #fda4af | Find counter text when nothing matches |
--c2-log-viewer__find-field--width | CSS value | 200px | Find field width |
--c2-log-viewer__find-field--background | color | #0b1220 | Find field surface |
--c2-log-viewer__find-field--color | color | #e5edf8 | Find field text |
--c2-log-viewer__find-field--border | CSS value | 1px solid #2c4366 | Find field edge |
--c2-log-viewer__find-field__focus--border | CSS value | 1px solid #60a5fa | Focused find field edge |
--c2-log-viewer__find-icon--color | color | #8aa0bd | Find field magnifier, clear icon and placeholder |
--c2-log-viewer__find-button--size | CSS value | 28px | Find bar button size |
--c2-log-viewer__find-button--color | color | #dbeafe | Find bar button icon |
--c2-log-viewer__find-button__hover--background | color | #2a4263 | Hovered find bar button surface |
--c2-log-viewer__find-button__selected--background | color | #2a4263 | Pressed match case button surface |
--c2-log-viewer__find-button__focus--outline | CSS value | 2px solid #60a5fa | Find bar button keyboard focus |
--c2-log-viewer__ruler--width | CSS value | 6px | Width of the find ruler along the right edge |
--c2-log-viewer__ruler--color | color | rgba(250, 204, 21, 0.55) | Find ruler tick of an entry with matches |
--c2-log-viewer__ruler__current--color | color | #fbbf24 | Find ruler tick of the current match |
--c2-log-viewer__copy--size | CSS value | 28px | Copy button size |
--c2-log-viewer__copy--icon-size | CSS value | 55% | Copy and success icon width and height |
--c2-log-viewer__copy--stroke-width | number | 1.8 | Copy and success SVG stroke width |
--c2-log-viewer__copy--inset | CSS value | 8px | Copy button offset from viewport edges |
--c2-log-viewer__copy--padding-top | CSS value | 4px | Space above the copy button within an entry |
--c2-log-viewer__copy--background | color | transparent | Copy button surface |
--c2-log-viewer__copy--color | color | #dbeafe | Copy icon color |
--c2-log-viewer__copy--border | CSS value | none | Copy button edge |
--c2-log-viewer__copy--border-radius | CSS value | 6px | Copy button corners |
--c2-log-viewer__copy__hover--background | color | #2a4263 | Hovered copy button surface |
--c2-log-viewer__copy__focus--outline | CSS value | 2px solid #60a5fa | Copy button keyboard focus |
--c2-log-viewer__token--color | color | #93c5fd | Quoted values, numbers, URLs and recognizable IDs in log text |
Text and languages
The text the component shows, in English. It shows another language when the app adds one with addTranslations, under log-viewer, and the nearest lang asks for it; any message not translated stays in English. {0}, {1}… stand for the values a message carries. Languages guide.
| Key | English | Values |
|---|---|---|
content | Log content | — |
noEntries | No log entries | — |
noMatches | No matching entries | — |
copy | Copy message | — |
copyEntry | Copy message {0} | {0} index |
copied | Copied | — |
copiedEntry | Copied message {0} | {0} index |
copyFailed | Unable to copy message. Try again. | — |
find | Find in log | — |
findCount | {0} of {1} | {0} current {1} total |
findMatch | Match {0} of {1} | {0} current {1} total |
findWrapped | Match {0} of {1}, wrapped | {0} current {1} total |
findNone | No results | — |
matchCase | Match case | — |
previousMatch | Previous match | — |
nextMatch | Next match | — |
closeFind | Close find | — |