mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-02 16:20:54 +03:00
fix(web-info): имя журнала ошибок из httpd.conf + описание вывода вместо примера
Секция «Последние ошибки» всегда печатала «(нет файла)»: путь был захардкожен как logs/error.log, а сборка Apache пишет logs/error_log. Имя берём из директивы ErrorLog, с фолбэком на оба общепринятых имени. В SKILL.md дословный пример вывода заменён легендой: модель и так видит реальный stdout, ей нужна семантика тегов и признаков, а не их копия (и копия дрейфует). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
fbf4d4f986
commit
88535a759b
@@ -144,8 +144,24 @@ if ($pubMatches.Count -eq 0) {
|
||||
Write-Host ""
|
||||
Write-Host "=== Последние ошибки ===" -ForegroundColor Cyan
|
||||
|
||||
$errorLog = Join-Path (Join-Path $ApachePath "logs") "error.log"
|
||||
if (Test-Path $errorLog) {
|
||||
# Имя файла берём из httpd.conf: сборки Apache расходятся (error.log / error_log)
|
||||
$errorLog = $null
|
||||
if ($confContent -match '(?m)^\s*ErrorLog\s+"?([^"\r\n]+)"?') {
|
||||
$logPath = $Matches[1].Trim()
|
||||
if ([System.IO.Path]::IsPathRooted($logPath)) {
|
||||
$errorLog = $logPath
|
||||
} else {
|
||||
$errorLog = Join-Path $ApachePath ($logPath -replace '/','\')
|
||||
}
|
||||
}
|
||||
if (-not $errorLog -or -not (Test-Path $errorLog)) {
|
||||
$errorLog = @("error_log", "error.log") |
|
||||
ForEach-Object { Join-Path (Join-Path $ApachePath "logs") $_ } |
|
||||
Where-Object { Test-Path $_ } |
|
||||
Select-Object -First 1
|
||||
}
|
||||
|
||||
if ($errorLog -and (Test-Path $errorLog)) {
|
||||
$lines = Get-Content $errorLog -Tail 5 -ErrorAction SilentlyContinue
|
||||
if ($lines -and $lines.Count -gt 0) {
|
||||
foreach ($line in $lines) {
|
||||
|
||||
Reference in New Issue
Block a user