增加基础配置
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-07-12 11:59:33 +08:00
parent fb50096e66
commit 8a3ab17b25
44 changed files with 1599 additions and 66 deletions

View File

@ -15,6 +15,7 @@ declare(strict_types=1);
namespace App\Log;
use App\Context\ApiUrlContext;
use Hyperf\Context\Context;
use Hyperf\Coroutine\Coroutine;
use Monolog\LogRecord;
@ -37,6 +38,12 @@ class AppendRequestIdProcessor implements ProcessorInterface
public function __invoke(LogRecord $record): array|LogRecord
{
$contextData = ApiUrlContext::getApiUrl();
if ($contextData) {
$record['extra']['api_url'] = $contextData;
}
$record['extra']['request_id'] = Context::getOrSet(self::REQUEST_ID, uniqid('xw_cloud'));
$record['extra']['coroutine_id'] = Coroutine::id();
return $record;