{
                        var logLines = xhr.responseText.split("\n").reverse().join("\n");
                        document.getElementById('logContent').textContent = logLines;
                    } else {
                        document.getElementById('logContent').textContent = 'Failed to load log.';
                    }
                };
                xhr.onerror = function () {
                    document.getElementById('logContent').textContent = 'Error loading log.';
                };
        