...
{#each content.split('\n') as line, index}
{@html line}
{/each}...
{ minTs = undefined maxTs = undefined allLogs = undefined minTsManual = detail getAllLogs(minTsManual, maxTsManual) }} placement="top-start" />
{ minTs = undefined maxTs = undefined allLogs = undefined getAllLogs(minTsManual, maxTsManual) }} serviceLogsChoices loadText={searchTerm === '' ? 'Last 1000 logfiles' : 'All time'} />
{ minTs = undefined maxTs = undefined allLogs = undefined maxTsManual = detail getAllLogs(minTsManual, maxTsManual) }} />
0' }} on:change={() => { allLogs = undefined getAllLogs(minTs, maxTs) }} /> { if (e.detail) { getAllLogs(maxTs, undefined) } else { timeout && clearTimeout(timeout) } }} options={{ right: 'auto-refresh' }} />
{#if allLogs == undefined}
{:else if Object.keys(allLogs).length == 0}
No logs
{:else if minTs && maxTs} {@const minTsN = new Date(minTs).getTime()} {@const maxTsN = new Date(maxTs).getTime()} {@const diff = maxTsN - minTsN} {#if searchTerm === ''}
{new Date(minTs).toLocaleTimeString([], { day: '2-digit', month: '2-digit', hour: '2-digit', minute: '2-digit' })}
{new Date(maxTs).toLocaleTimeString([], { day: '2-digit', month: '2-digit', hour: '2-digit', minute: '2-digit' })}
{/if} {#each Object.entries(allLogsOrQueryResults(allLogs, countsPerHost)) as [mode, o1]}

{mode}s

{#each Object.entries(o1) as [wg, o2]}
{#if wg && wg != ''}

{wg}

{/if}
{#each Object.entries(o2).filter(([hn, files]) => { if (selected && selected[0] === mode && selected[1] === wg && selected[2] === hn) { return true } const hostKey = `${mode},${wg},${hn}` if (countsPerHost && (countsPerHost[hostKey] == undefined || countsPerHost[hostKey].doc_count === 0)) { return false } return true }) as [hn, files]} {@const hostKey = `${mode},${wg},${hn}`}
{ selected = [mode, wg, hn] upToIsLatest = true upTo = getLatestUpTo(selected) scrollToBottom() }} >
{truncateRev(hn, countsPerHost || loadingLogs ? 40 : 8)}
{#if loadingLogCounts} {:else if countsPerHost}
{countsPerHost[hostKey]?.doc_count ?? 0} matches
{:else}
{#each files as file} {@const okHeight = 100.0 * ((file.ok_lines * 1.0) / (max_lines ?? 1))} {@const errHeight = 100.0 * ((file.err_lines * 1.0) / (max_lines ?? 1))}
{/each}
{/if}
{/each}
{/each}
{/each} {#if !loadingLogCounts && sumOtherDocCount != 0}
Note: {sumOtherDocCount} additional matches weren't grouped into any of the above hosts.
{/if} {/if}
{#if selected} {#if !loadingLogs && logs == undefined}
1 min delay: logs are compacted before being available
{/if}
{#if loadingLogs}
{:else if logs != undefined}
{#each logs.hits as { snippet_fragment, snippet_highlighted, document }} { let logLineNumber = document.line_number[0] let logFile = document.file_name[0] let host = document.host[0] let jsonFmt = document.json_fmt[0] seeLogContext(logLineNumber, logFile, host, jsonFmt) }} /> {/each} {#if logs.hits.length === 0}
No logs
{/if} {#if logs.hits.length === 1000}
Older matches were truncated from this search, try refining your filters to get more precise results.
{/if}
{:else} {#each getLogs(selected, upTo) as file}
{new Date(file.ts).toLocaleTimeString([], { day: '2-digit', month: '2-digit', hour: '2-digit', minute: '2-digit' })}
{#if logsContent[file.file_path] == undefined}
{:else if logsContent[file.file_path]} {#if logsContent[file.file_path].error} {#if logsContent[file.file_path].error?.startsWith('Not Found')}
Log file is missing. Log files require a shared log volume to be mounted across servers and workers or to use the EE S3/object storage integration for logs. To avoid mounting a shared volume, set the EE object store logs in the instance settings
{:else}
{logsContent[file.file_path].error}
{/if} {:else if logsContent[file.file_path].content}
{:else}
No logs
{/if} {/if}
{/each} {/if}
{#if searchTerm == ''}
Last 5 log files up to:
{#if upTo} {:else}
{/if}
{#if upTo} {:else}
{/if}
{/if} {:else}
Select a host to see its logs
{/if}