@using System.Text Logs
    @_stringBuilder
@code { StringBuilder _stringBuilder = new(); protected override void OnInitialized() { //intecept stdout with textwriter to get logs var sw = new StringWriter(_stringBuilder); Console.SetOut(sw); Console.SetError(sw); //keep updated int length = 0; Task.Run(async () => { while (true) { await Task.Delay(100); if (_stringBuilder.Length != length) { StateHasChanged(); length = _stringBuilder.Length; } } // ReSharper disable once FunctionNeverReturns - This is intentional behavior }); base.OnInitialized(); } }