Laravel 13의 custom·via와 LogManager::extend()를 구분해 사용하고, 채널 보관, forgetChannel(), 폴백을 고려해 로그 기능을 테스트합니다.
페이지 듣기약 11분
패키지 고유의 로그 출력을 제공하고 싶을 때는 로거를 만드는 구조와 사용하는 애플리케이션이 선택하는 채널 설정을 분리합니다. 드라이버를 등록하는 것만으로 기존 채널이 다시 만들어지는 것은 아니며, 설정을 변경한 후에도 이전 Handler가 사용되는 경우가 있습니다.이 페이지는 Laravel Framework v13.39.0의 구현을 확인한 내용입니다. 기본 조작은 로깅을, 프로바이더 준비는 패키지 개발을 참조하세요.
필요한 확장 포인트 선택하기
기존 드라이버로 구현할 수 있다면 독자적인 드라이버를 늘릴 필요는 없습니다.
하고 싶은 것
선택지
확장하는 곳
기존 채널의 포매터 등을 조정한다
tap
생성된 Illuminate\Log\Logger
Monolog의 Handler를 설정으로 선택한다
driver: monolog
handler, handler_with 등의 설정
패키지의 팩토리로 로거를 구성한다
driver: custom과 via
__invoke(array $config)를 가진 클래스
패키지 고유의 드라이버 이름을 공개한다
LogManager::extend()
애플리케이션과 설정 배열을 받는 클로저
via 클래스와 tap 클래스는 컨테이너에서 해석되므로 생성자 주입도 사용할 수 있습니다. tap은 채널 생성 시의 조정이며, 로그를 1건 기록할 때마다 실행되는 훅이 아닙니다.
logging.channels.audit의 audit은 채널 이름입니다. 그 안의 driver는 생성 방법의 이름입니다. Log::channel('audit')로 선택하는 것은 채널 이름이므로, 나중에 드라이버를 변경해도 호출하는 쪽의 이름을 유지할 수 있습니다.
먼저 custom과 via로 팩토리를 공개하기
가상의 Acme\Audit 패키지에서 파일 출력용 팩토리를 제공합니다. PSR-4로 로드할 수 있는 src/Logging/CreateAuditLogger.php에 배치합니다.
<?phpnamespace Acme\Audit\Logging;use Monolog\Handler\StreamHandler;use Monolog\Logger;final class CreateAuditLogger{ public function __invoke(array $config): Logger { return new Logger( $config['name'] ?? 'acme-audit', [new StreamHandler($config['path'], $config['level'] ?? 'info')], ); }}
사용하는 애플리케이션에서는 config/logging.php의 기존 channels 배열에 다음 요소를 추가합니다. 기존 default나 stack 설정은 그대로 둡니다.
LogManager::createCustomDriver()는 via 클래스를 컨테이너에서 가져와 채널의 설정 배열을 유일한 인수로 호출합니다. 이 방식만 사용한다면 드라이버 등록용 프로바이더는 필요 없습니다.
use Illuminate\Support\Facades\Log;Log::channel('audit')->info('주문을 확정했습니다.', ['order_id' => 42]);
이 팩토리에서는 level을 StreamHandler에 명시적으로 전달합니다. custom 팩토리가 반환하는 로거에 대해 LogManager가 설정의 level을 일률적으로 적용하는 것은 아닙니다. 독자적인 설정 항목을 추가한 경우에도 팩토리 쪽에서 반영합니다.
단순히 파일의 출력 위치만 바꾸는 것이라면 single 드라이버로 충분합니다. 이 예는 패키지 고유의 Handler나 초기화를 포함하기 위한 최소 구성입니다. via는 설정 캐시에 저장할 수 있는 클래스 이름으로 하고, 설정 배열에 클로저나 로거 인스턴스를 저장하지 마세요.
독자적인 드라이버 이름을 제공할 때는 extend를 사용하기
사용하는 쪽에 driver: acme-audit라는 설정을 공개하고 싶다면, 같은 팩토리를 사용하는 드라이버를 등록합니다. src/AuditServiceProvider.php의 boot()에서 Laravel의 log 서비스를 확장합니다.
<?phpnamespace Acme\Audit;use Acme\Audit\Logging\CreateAuditLogger;use Illuminate\Contracts\Foundation\Application;use Illuminate\Log\LogManager;use Illuminate\Support\ServiceProvider;use Monolog\Logger as Monolog;class AuditServiceProvider extends ServiceProvider{ public function boot(): void { $this->callAfterResolving('log', static function (LogManager $manager): void { $manager->extend('acme-audit', static function (Application $app, array $config): Monolog { return $app->make(CreateAuditLogger::class)($config); }); }); }}
프로바이더는 패키지 자동 검색 등으로 로드합니다. 사용하는 쪽의 channels.audit은 앞의 설정에서 다음 설정으로 교체합니다. via는 더 이상 필요하지 않습니다.
Laravel의 LogServiceProvider는 log를 singleton으로 등록합니다. callAfterResolving()은 아직 해석되지 않았다면 기다리고, 이미 해석되었다면 그 인스턴스에도 등록을 반영합니다. 자세한 내용은 서비스 해석 후 훅을 참조하세요.
extend()는 생성용 클로저를 등록할 뿐입니다. 채널 생성이나 로그 기록은 이 콜백을 등록하는 시점에는 수행하지 않습니다.
callCustomCreator()는 클로저에 $app과 채널 설정 배열을 전달합니다. via 팩토리에 전달되는 인수와는 다릅니다.
같은 드라이버 이름을 다시 등록하면 생성용 클로저를 덮어씁니다. single 등의 내장 이름이나 다른 패키지와 충돌하는 이름은 사용하지 마세요.
확인한 구현에서는 extend()에 전달한 익명 클로저가 LogManager의 스코프로 다시 바인딩됩니다. 비static 클로저의 $this는 서비스 프로바이더가 아닙니다. 예와 같이 static 클로저에서 인수 $app을 사용하고, 프로바이더의 $this에 의존하지 않는 구현으로 합니다.
패키지는 드라이버를 제공하고, 어느 채널이나 stack에서 사용할지는 사용하는 쪽이 선택합니다. 프로바이더에서 logging.default나 기존 logging.channels 전체를 덮어쓰지 않는 설계로 하세요.
채널은 이름별로 보관된다
LogManager::get()은 해석한 채널을 $channels에 저장합니다. 같은 이름의 채널을 가져오면 설정 배열을 다시 읽지 않고 보관된 객체를 반환합니다.이는 파일에 저장하는 설정 캐시와는 별개인, 현재 LogManager 안의 객체 보관입니다. config() 변경이나 extend() 재등록만으로는 이미 생성된 Handler가 교체되지 않습니다.
use Illuminate\Support\Facades\Log;$before = Log::channel('audit');config(['logging.channels.audit.level' => 'error']);$same = Log::channel('audit');Log::forgetChannel('audit');$after = Log::channel('audit');
이 예의 $same은 $before와 같은 객체입니다. forgetChannel('audit')가 Manager의 보관을 해제하면, 다음 가져오기에서 새로운 설정으로 $after가 생성됩니다.
forgetChannel은 기존 참조를 갱신하지 않는다
forgetChannel()이 수행하는 것은 Manager 안의 엔트리 삭제입니다.
$before를 보관하고 있는 서비스는 그 이후에도 이전 로거를 사용할 수 있습니다. 기존 참조를 새로운 객체로 교체하는 조작이 아닙니다.
Log::channel('stack') 등으로 이미 생성된 stack은 자식 채널의 Handler와 Processor를 모은 독립된 Monolog를 가집니다. 자식만 forgetChannel()해도 기존 stack의 구성은 바뀌지 않습니다. 필요하다면 그 stack의 채널 이름에 대해서도 보관을 해제하고 다시 가져옵니다.
forgetChannel() 자체는 Handler의 close()를 호출하지 않습니다. 연결이나 버퍼의 종료 처리까지 보장하는 API가 아닙니다.
일반적인 배포에서는 설정 캐시 갱신과 사용 중인 장기 실행 워커의 재시작을 운영 절차에 포함합니다. 요청마다 설정을 덮어쓰고 다시 해석하는 구조에 의존하지 말고, 서비스의 라이프사이클도 고려하세요.
stack에 포함하려면 Monolog 호환 조작도 필요
독자적인 드라이버는 Psr\Log\LoggerInterface 구현을 반환할 수 있지만, Laravel의 createStackDriver()는 자식 채널에 대해 getHandlers()와 getProcessors()를 호출합니다. 이들은 PSR 인터페이스에 포함되지 않습니다.임의의 PSR 로거를 반환한다고 해서 stack에서도 동작한다고는 할 수 없으므로, stack에 포함하는 것도 제공하는 패키지에서는 예와 같이 Monolog를 반환하거나 그 사용 범위를 명시하고 테스트합니다.
목뿐만 아니라 실제 채널 해석을 검증하기
Log::shouldReceive('channel')만으로는 프로바이더 등록, 팩토리 선택, 설정 반영을 확인할 수 없습니다. 다음은 패키지 테스트 환경에서 실제 Manager와 팩토리를 거치는 예입니다.테스트용 출력 위치에는 php://memory를 지정합니다. 여기서는 채널 구축과 Handler 설정을 검증하며, 로그 기록 자체는 수행하지 않습니다.
LogManager::get()은 채널 생성 중에 발생한 예외를 포착하고 emergency logger를 반환하는 경우가 있습니다. “예외가 발생하지 않았다”, “LoggerInterface였다”는 확인만으로는 목적한 채널이 구축되었다는 증거가 되지 않습니다. 위의 테스트에서는 Monolog의 이름, Handler, 로그 레벨도 확인해 폴백을 성공으로 오인하지 않도록 하고 있습니다. 생성 후의 기록 오류까지 같은 구조로 반드시 포착되는 것은 아닙니다.
장기 유지보수에서 추가하는 검증
변경이나 사용 방법
확인할 것
tap 추가
실제 팩토리가 반환하는 로거에 대해 기대하는 조정이 적용된다
stack에 포함
자식 채널의 Handler와 Processor가 포함되고, 재해석 시의 구성도 올바르다
출력 위치나 포맷 변경
실제 기록 내용, 권한, 로테이션 등을 별도의 검증 환경에서 확인한다
등록 시점 변경
log가 이미 해석된 상태여도 드라이버가 등록되고 채널을 생성할 수 있다
Laravel 업데이트
콜백의 인수와 스코프, 보관 해제, emergency logger로의 폴백을 계속 확인한다
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Knowledge of Laravel","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/invokable/AuZ0xql2mAbUyZ99/logo/light.svg?fit=max\u0026auto=format\u0026n=AuZ0xql2mAbUyZ99\u0026q=85\u0026s=df0b7397202a6aa1c1f321620c5aa146","dark":"https://mintcdn.com/invokable/AuZ0xql2mAbUyZ99/logo/dark.svg?fit=max\u0026auto=format\u0026n=AuZ0xql2mAbUyZ99\u0026q=85\u0026s=a8a0340d86ff8aa90e9adfc98a0362d7","href":"/"},"favicon":"https://mintcdn.com/invokable/AuZ0xql2mAbUyZ99/favicon.svg?fit=max\u0026auto=format\u0026n=AuZ0xql2mAbUyZ99\u0026q=85\u0026s=8f5a03a681c95d31803fc237b5811065","api":{"playground":{"display":"simple"}},"navbar":{},"footer":{"socials":{"github":"https://github.com/invokable"}},"seo":{"metatags":{"canonical":"https://kawax.biz"},"indexing":"all"},"styling":{"eyebrows":"breadcrumbs","latex":true},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"interaction":{"drilldown":false},"metadata":{"timestamp":true},"navigation":{"languages":[{"language":"jp","default":true,"href":"jp/packages/laravel-boost-copilot-cli"},{"language":"en","href":"en/packages/laravel-boost-copilot-cli"},{"language":"de","href":"de/packages/laravel-boost-copilot-cli"},{"language":"es","href":"es/packages/laravel-boost-copilot-cli"},{"language":"fr","href":"fr/packages/laravel-boost-copilot-cli"},{"language":"it","href":"it/packages/laravel-boost-copilot-cli"},{"language":"ko","href":"ko/packages/laravel-boost-copilot-cli"},{"language":"nl","href":"nl/packages/laravel-boost-copilot-cli"},{"language":"zh-Hans","href":"zh-CN/packages/laravel-boost-copilot-cli"},{"language":"zh-Hant","href":"zh-TW/packages/laravel-boost-copilot-cli"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"invokable","hasAudioNarration":true,"actualSubdomain":"invokable","customDomains":["kawax.biz"],"gitSource":{"type":"github","owner":"kawax","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6afce0b023d02314dbd9dee1","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"en","tag":"My Packages","count":147},{"language":"jp","tag":"マイパッケージ","count":147},{"language":"de","tag":"Meine Pakete","count":102},{"language":"es","tag":"Mis paquetes","count":102},{"language":"fr","tag":"Mes packages","count":102},{"language":"it","tag":"I miei pacchetti","count":102},{"language":"ko","tag":"My 패키지","count":102},{"language":"nl","tag":"Mijn packages","count":102},{"language":"zh-Hans","tag":"我的包","count":102},{"language":"zh-Hant","tag":"我的套件","count":102},{"language":"de","tag":"Fortgeschrittene Themen","count":88},{"language":"en","tag":"Advanced Topics","count":88},{"language":"es","tag":"Temas avanzados","count":88},{"language":"fr","tag":"Sujets avancés","count":88},{"language":"it","tag":"Argomenti avanzati","count":88},{"language":"jp","tag":"応用トピック","count":88},{"language":"ko","tag":"심화 주제","count":88},{"language":"nl","tag":"Geavanceerde onderwerpen","count":88},{"language":"zh-Hans","tag":"进阶主题","count":88},{"language":"zh-Hant","tag":"進階主題","count":88},{"language":"en","tag":"VOICEVOX","count":67},{"language":"jp","tag":"VOICEVOX","count":67},{"language":"de","tag":"Leitfaden","count":61},{"language":"en","tag":"Guide","count":61},{"language":"es","tag":"Guía","count":61},{"language":"fr","tag":"Guide","count":61},{"language":"it","tag":"Guida","count":61},{"language":"jp","tag":"ガイド","count":61},{"language":"ko","tag":"가이드","count":61},{"language":"nl","tag":"Gids","count":61},{"language":"zh-Hans","tag":"指南","count":61},{"language":"zh-Hant","tag":"指南","count":61},{"language":"de","tag":"Paketentwicklung","count":47},{"language":"de","tag":"Blog","count":47},{"language":"en","tag":"Package Development","count":47},{"language":"en","tag":"Blog","count":47},{"language":"es","tag":"Desarrollo de paquetes","count":47},{"language":"es","tag":"Blog","count":47},{"language":"fr","tag":"Développement de packages","count":47},{"language":"fr","tag":"Blog","count":47},{"language":"it","tag":"Sviluppo di pacchetti","count":47},{"language":"it","tag":"Blog","count":47},{"language":"jp","tag":"パッケージ開発","count":47},{"language":"jp","tag":"ブログ","count":47},{"language":"ko","tag":"패키지 개발","count":47},{"language":"ko","tag":"블로그","count":47},{"language":"nl","tag":"Package-ontwikkeling","count":47},{"language":"nl","tag":"Blog","count":47},{"language":"zh-Hans","tag":"包开发","count":47},{"language":"zh-Hans","tag":"博客","count":47},{"language":"zh-Hant","tag":"套件開發","count":47},{"language":"zh-Hant","tag":"部落格","count":47},{"language":"de","tag":"GitHub Copilot","count":45},{"language":"en","tag":"GitHub Copilot","count":45},{"language":"en","tag":"VOICEVOX Engine API Reference","count":45},{"language":"es","tag":"GitHub Copilot","count":45},{"language":"fr","tag":"GitHub Copilot","count":45},{"language":"it","tag":"GitHub Copilot","count":45},{"language":"jp","tag":"GitHub Copilot","count":45},{"language":"jp","tag":"VOICEVOXエンジンAPIリファレンス","count":45},{"language":"ko","tag":"GitHub Copilot","count":45},{"language":"nl","tag":"GitHub Copilot","count":45},{"language":"zh-Hans","tag":"GitHub Copilot","count":45},{"language":"zh-Hant","tag":"GitHub Copilot","count":45},{"language":"de","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"en","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"es","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"fr","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"it","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"jp","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"ko","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"nl","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"zh-Hans","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"zh-Hant","tag":"GitHub Copilot SDK for Laravel","count":43},{"language":"de","tag":"Tutorial","count":35},{"language":"en","tag":"Tutorial","count":35},{"language":"es","tag":"Tutorial","count":35},{"language":"fr","tag":"Tutoriel","count":35},{"language":"it","tag":"Tutorial","count":35},{"language":"jp","tag":"チュートリアル","count":35},{"language":"ko","tag":"튜토리얼","count":35},{"language":"nl","tag":"Tutorial","count":35},{"language":"zh-Hans","tag":"教程","count":35},{"language":"zh-Hant","tag":"教學","count":35},{"language":"de","tag":"SDK","count":27},{"language":"es","tag":"SDK","count":27},{"language":"fr","tag":"SDK","count":27},{"language":"it","tag":"SDK","count":27},{"language":"ko","tag":"SDK","count":27},{"language":"nl","tag":"SDK","count":27},{"language":"zh-Hans","tag":"SDK","count":27},{"language":"zh-Hant","tag":"SDK","count":27},{"language":"de","tag":"VOICEVOX","count":22},{"language":"es","tag":"VOICEVOX","count":22},{"language":"fr","tag":"VOICEVOX","count":22},{"language":"it","tag":"VOICEVOX","count":22},{"language":"ko","tag":"VOICEVOX","count":22},{"language":"nl","tag":"VOICEVOX","count":22},{"language":"zh-Hans","tag":"VOICEVOX","count":22},{"language":"zh-Hant","tag":"VOICEVOX","count":22}],"searchSettings":{"isFiltersEnabled":false,"showContentSnippets":true,"fullPageSearch":true}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"ko/advanced/package-logging","slug":"/ko/advanced/package-logging","pageMetadata":{"title":"패키지의 로그 채널 확장과 재해석","description":"Laravel 13의 custom·via와 LogManager::extend()를 구분해 사용하고, 채널 보관, forgetChannel(), 폴백을 고려해 로그 기능을 테스트합니다.","href":"/ko/advanced/package-logging"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Laravel 13의 custom·via와 LogManager::extend()를 구분해 사용하고, 채널 보관, forgetChannel(), 폴백을 고려해 로그 기능을 테스트합니다.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,Mermaid,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`패키지 고유의 로그 출력을 제공하고 싶을 때는 `,_jsx(_components.strong,{children:`로거를 만드는 구조`}),`와 `,_jsx(_components.strong,{children:`사용하는 애플리케이션이 선택하는 채널 설정`}),`을 분리합니다. 드라이버를 등록하는 것만으로 기존 채널이 다시 만들어지는 것은 아니며, 설정을 변경한 후에도 이전 Handler가 사용되는 경우가 있습니다.`]}),`\n`,_jsxs(_components.p,{children:[`이 페이지는 Laravel Framework `,_jsx(_components.code,{children:`v13.39.0`}),`의 구현을 확인한 내용입니다. 기본 조작은 `,_jsx(_components.a,{href:`/ko/logging`,children:`로깅`}),`을, 프로바이더 준비는 `,_jsx(_components.a,{href:`/ko/advanced/package-development`,children:`패키지 개발`}),`을 참조하세요.`]}),`\n`,_jsx(Heading,{level:`2`,id:`필요한-확장-포인트-선택하기`,children:`필요한 확장 포인트 선택하기`}),`\n`,_jsx(_components.p,{children:`기존 드라이버로 구현할 수 있다면 독자적인 드라이버를 늘릴 필요는 없습니다.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`하고 싶은 것`}),_jsx(_components.th,{children:`선택지`}),_jsx(_components.th,{children:`확장하는 곳`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`기존 채널의 포매터 등을 조정한다`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`tap`})}),_jsxs(_components.td,{children:[`생성된 `,_jsx(_components.code,{children:`Illuminate\\\\Log\\\\Logger`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Monolog의 Handler를 설정으로 선택한다`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`driver: monolog`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`handler`}),`, `,_jsx(_components.code,{children:`handler_with`}),` 등의 설정`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`패키지의 팩토리로 로거를 구성한다`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`driver: custom`}),`과 `,_jsx(_components.code,{children:`via`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`__invoke(array $config)`}),`를 가진 클래스`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`패키지 고유의 드라이버 이름을 공개한다`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`LogManager::extend()`})}),_jsx(_components.td,{children:`애플리케이션과 설정 배열을 받는 클로저`})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`via`}),` 클래스와 `,_jsx(_components.code,{children:`tap`}),` 클래스는 컨테이너에서 해석되므로 생성자 주입도 사용할 수 있습니다. `,_jsx(_components.code,{children:`tap`}),`은 채널 생성 시의 조정이며, 로그를 1건 기록할 때마다 실행되는 훅이 아닙니다.`]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`logging.channels.audit`}),`의 `,_jsx(_components.code,{children:`audit`}),`은 `,_jsx(_components.strong,{children:`채널 이름`}),`입니다. 그 안의 `,_jsx(_components.code,{children:`driver`}),`는 `,_jsx(_components.strong,{children:`생성 방법의 이름`}),`입니다. `,_jsx(_components.code,{children:`Log::channel('audit')`}),`로 선택하는 것은 채널 이름이므로, 나중에 드라이버를 변경해도 호출하는 쪽의 이름을 유지할 수 있습니다.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`먼저-custom과-via로-팩토리를-공개하기`,children:`먼저 custom과 via로 팩토리를 공개하기`}),`\n`,_jsxs(_components.p,{children:[`가상의 `,_jsx(_components.code,{children:`Acme\\\\Audit`}),` 패키지에서 파일 출력용 팩토리를 제공합니다. PSR-4로 로드할 수 있는 `,_jsx(_components.code,{children:`src/Logging/CreateAuditLogger.php`}),`에 배치합니다.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`namespace`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Acme\\\\Audit\\\\Logging`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Monolog\\\\Handler\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`StreamHandler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Monolog\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Logger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`final`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` CreateAuditLogger`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` __invoke`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`array`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Logger`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Logger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'name'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`??`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'acme-audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` StreamHandler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'path'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`], `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'level'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`??`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'info'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`사용하는 애플리케이션에서는 `,_jsx(_components.code,{children:`config/logging.php`}),`의 기존 `,_jsx(_components.code,{children:`channels`}),` 배열에 다음 요소를 추가합니다. 기존 `,_jsx(_components.code,{children:`default`}),`나 `,_jsx(_components.code,{children:`stack`}),` 설정은 그대로 둡니다.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'driver'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'custom'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'via'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\Acme\\\\Audit\\\\Logging\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`CreateAuditLogger`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'path'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` storage_path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'logs/audit.log'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'level'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'info'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`LogManager::createCustomDriver()`}),`는 `,_jsx(_components.code,{children:`via`}),` 클래스를 컨테이너에서 가져와 채널의 설정 배열을 유일한 인수로 호출합니다. 이 방식만 사용한다면 드라이버 등록용 프로바이더는 필요 없습니다.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Support\\\\Facades\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`info`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'주문을 확정했습니다.'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'order_id'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 42`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`이 팩토리에서는 `,_jsx(_components.code,{children:`level`}),`을 StreamHandler에 명시적으로 전달합니다. `,_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`custom`}),` 팩토리가 반환하는 로거에 대해 LogManager가 설정의 `,_jsx(_components.code,{children:`level`}),`을 일률적으로 적용하는 것은 아닙니다`]}),`. 독자적인 설정 항목을 추가한 경우에도 팩토리 쪽에서 반영합니다.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`단순히 파일의 출력 위치만 바꾸는 것이라면 `,_jsx(_components.code,{children:`single`}),` 드라이버로 충분합니다. 이 예는 패키지 고유의 Handler나 초기화를 포함하기 위한 최소 구성입니다. `,_jsx(_components.code,{children:`via`}),`는 설정 캐시에 저장할 수 있는 클래스 이름으로 하고, 설정 배열에 클로저나 로거 인스턴스를 저장하지 마세요.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`독자적인-드라이버-이름을-제공할-때는-extend를-사용하기`,children:`독자적인 드라이버 이름을 제공할 때는 extend를 사용하기`}),`\n`,_jsxs(_components.p,{children:[`사용하는 쪽에 `,_jsx(_components.code,{children:`driver: acme-audit`}),`라는 설정을 공개하고 싶다면, 같은 팩토리를 사용하는 드라이버를 등록합니다. `,_jsx(_components.code,{children:`src/AuditServiceProvider.php`}),`의 `,_jsx(_components.code,{children:`boot()`}),`에서 Laravel의 `,_jsx(_components.code,{children:`log`}),` 서비스를 확장합니다.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`namespace`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Acme\\\\Audit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Acme\\\\Audit\\\\Logging\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`CreateAuditLogger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Contracts\\\\Foundation\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Application`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Log\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`LogManager`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Support\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`ServiceProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Monolog\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Logger`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` as`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Monolog`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` AuditServiceProvider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` extends`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` ServiceProvider`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` boot`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`callAfterResolving`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'log'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`static`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`LogManager`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $manager`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $manager`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`extend`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'acme-audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`static`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Application`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`array`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Monolog`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $app`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`make`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`CreateAuditLogger`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`프로바이더는 `,_jsx(_components.a,{href:`/ko/advanced/package-discovery`,children:`패키지 자동 검색`}),` 등으로 로드합니다. 사용하는 쪽의 `,_jsx(_components.code,{children:`channels.audit`}),`은 앞의 설정에서 다음 설정으로 교체합니다. `,_jsx(_components.code,{children:`via`}),`는 더 이상 필요하지 않습니다.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'driver'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'acme-audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'path'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` storage_path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'logs/audit.log'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'level'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'info'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Laravel의 `,_jsx(_components.code,{children:`LogServiceProvider`}),`는 `,_jsx(_components.code,{children:`log`}),`를 singleton으로 등록합니다. `,_jsx(_components.code,{children:`callAfterResolving()`}),`은 아직 해석되지 않았다면 기다리고, 이미 해석되었다면 그 인스턴스에도 등록을 반영합니다. 자세한 내용은 `,_jsx(_components.a,{href:`/ko/advanced/package-service-resolution`,children:`서비스 해석 후 훅`}),`을 참조하세요.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`extend()`}),`는 생성용 클로저를 등록할 뿐입니다. 채널 생성이나 로그 기록은 이 콜백을 등록하는 시점에는 수행하지 않습니다.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`callCustomCreator()`}),`는 클로저에 `,_jsx(_components.code,{children:`$app`}),`과 채널 설정 배열을 전달합니다. `,_jsx(_components.code,{children:`via`}),` 팩토리에 전달되는 인수와는 다릅니다.`]}),`\n`,_jsxs(_components.li,{children:[`같은 드라이버 이름을 다시 등록하면 생성용 클로저를 덮어씁니다. `,_jsx(_components.code,{children:`single`}),` 등의 내장 이름이나 다른 패키지와 충돌하는 이름은 사용하지 마세요.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`확인한 구현에서는 `,_jsx(_components.code,{children:`extend()`}),`에 전달한 익명 클로저가 LogManager의 스코프로 다시 바인딩됩니다. 비static 클로저의 `,_jsx(_components.code,{children:`$this`}),`는 서비스 프로바이더가 아닙니다. 예와 같이 static 클로저에서 인수 `,_jsx(_components.code,{children:`$app`}),`을 사용하고, 프로바이더의 `,_jsx(_components.code,{children:`$this`}),`에 의존하지 않는 구현으로 합니다.`]})}),`\n`,_jsxs(_components.p,{children:[`패키지는 드라이버를 제공하고, 어느 채널이나 stack에서 사용할지는 사용하는 쪽이 선택합니다. 프로바이더에서 `,_jsx(_components.code,{children:`logging.default`}),`나 기존 `,_jsx(_components.code,{children:`logging.channels`}),` 전체를 덮어쓰지 않는 설계로 하세요.`]}),`\n`,_jsx(Heading,{level:`2`,id:`채널은-이름별로-보관된다`,children:`채널은 이름별로 보관된다`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`LogManager::get()`}),`은 해석한 채널을 `,_jsx(_components.code,{children:`$channels`}),`에 저장합니다. 같은 이름의 채널을 가져오면 설정 배열을 다시 읽지 않고 보관된 객체를 반환합니다.`]}),`\n`,_jsx(Mermaid,{chart:`flowchart TD\n A[\"Log::channel('audit')\"] --> B{\"audit은 해석 완료?\"}\n B -->|Yes| C[\"보관된 Logger를 반환\"]\n B -->|No| D[\"channels.audit의 driver를 선택\"]\n D --> E[\"via 또는 extend의 팩토리\"]\n E --> F[\"Illuminate Logger로 래핑\u003cbr>tap과 공유 컨텍스트를 적용\"]\n F --> G[\"audit 이름으로 보관\"]`}),`\n`,_jsxs(_components.p,{children:[`이는 파일에 저장하는 설정 캐시와는 별개인, `,_jsx(_components.strong,{children:`현재 LogManager 안의 객체 보관`}),`입니다. `,_jsx(_components.code,{children:`config()`}),` 변경이나 `,_jsx(_components.code,{children:`extend()`}),` 재등록만으로는 이미 생성된 Handler가 교체되지 않습니다.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Support\\\\Facades\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$before`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'logging.channels.audit.level'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'error'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$same`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forgetChannel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$after`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`이 예의 `,_jsx(_components.code,{children:`$same`}),`은 `,_jsx(_components.code,{children:`$before`}),`와 같은 객체입니다. `,_jsx(_components.code,{children:`forgetChannel('audit')`}),`가 Manager의 보관을 해제하면, 다음 가져오기에서 새로운 설정으로 `,_jsx(_components.code,{children:`$after`}),`가 생성됩니다.`]}),`\n`,_jsx(Heading,{level:`3`,id:`forgetchannel은-기존-참조를-갱신하지-않는다`,children:`forgetChannel은 기존 참조를 갱신하지 않는다`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`forgetChannel()`}),`이 수행하는 것은 Manager 안의 엔트리 삭제입니다.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`$before`}),`를 보관하고 있는 서비스는 그 이후에도 이전 로거를 사용할 수 있습니다. 기존 참조를 새로운 객체로 교체하는 조작이 아닙니다.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Log::channel('stack')`}),` 등으로 이미 생성된 stack은 자식 채널의 Handler와 Processor를 모은 독립된 Monolog를 가집니다. 자식만 `,_jsx(_components.code,{children:`forgetChannel()`}),`해도 기존 stack의 구성은 바뀌지 않습니다. 필요하다면 그 stack의 채널 이름에 대해서도 보관을 해제하고 다시 가져옵니다.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`forgetChannel()`}),` 자체는 Handler의 `,_jsx(_components.code,{children:`close()`}),`를 호출하지 않습니다. 연결이나 버퍼의 종료 처리까지 보장하는 API가 아닙니다.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`일반적인 배포에서는 `,_jsx(_components.a,{href:`/ko/advanced/package-config-merging`,children:`설정 캐시 갱신`}),`과 사용 중인 장기 실행 워커의 재시작을 운영 절차에 포함합니다. 요청마다 설정을 덮어쓰고 다시 해석하는 구조에 의존하지 말고, `,_jsx(_components.a,{href:`/ko/advanced/package-service-lifetimes`,children:`서비스의 라이프사이클`}),`도 고려하세요.`]}),`\n`,_jsx(Heading,{level:`3`,id:`stack에-포함하려면-monolog-호환-조작도-필요`,children:`stack에 포함하려면 Monolog 호환 조작도 필요`}),`\n`,_jsxs(_components.p,{children:[`독자적인 드라이버는 `,_jsx(_components.code,{children:`Psr\\\\Log\\\\LoggerInterface`}),` 구현을 반환할 수 있지만, Laravel의 `,_jsx(_components.code,{children:`createStackDriver()`}),`는 자식 채널에 대해 `,_jsx(_components.code,{children:`getHandlers()`}),`와 `,_jsx(_components.code,{children:`getProcessors()`}),`를 호출합니다. 이들은 PSR 인터페이스에 포함되지 않습니다.`]}),`\n`,_jsx(_components.p,{children:`임의의 PSR 로거를 반환한다고 해서 stack에서도 동작한다고는 할 수 없으므로, stack에 포함하는 것도 제공하는 패키지에서는 예와 같이 Monolog를 반환하거나 그 사용 범위를 명시하고 테스트합니다.`}),`\n`,_jsx(Heading,{level:`2`,id:`목뿐만-아니라-실제-채널-해석을-검증하기`,children:`목뿐만 아니라 실제 채널 해석을 검증하기`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`Log::shouldReceive('channel')`}),`만으로는 프로바이더 등록, 팩토리 선택, 설정 반영을 확인할 수 없습니다. 다음은 `,_jsx(_components.a,{href:`/ko/advanced/package-testing`,children:`패키지 테스트 환경`}),`에서 실제 Manager와 팩토리를 거치는 예입니다.`]}),`\n`,_jsxs(_components.p,{children:[`테스트용 출력 위치에는 `,_jsx(_components.code,{children:`php://memory`}),`를 지정합니다. 여기서는 채널 구축과 Handler 설정을 검증하며, 로그 기록 자체는 수행하지 않습니다.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`80`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`80`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`php`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`namespace`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Acme\\\\Audit\\\\Tests`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Acme\\\\Audit\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`AuditServiceProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Acme\\\\Audit\\\\Logging\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`CreateAuditLogger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Log\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Logger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Illuminate\\\\Support\\\\Facades\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Monolog\\\\Handler\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`StreamHandler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Monolog\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Level`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Monolog\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Logger`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` as`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Monolog`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Orchestra\\\\Testbench\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`TestCase`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` AuditLoggingTest`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` extends`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` TestCase`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` protected`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getPackageProviders`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` array`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`AuditServiceProvider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` protected`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` defineEnvironment`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'config'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`set`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'logging.channels.audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'driver'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'acme-audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'path'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'php://memory'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'level'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'warning'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'config'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`set`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'logging.channels.emergency.path'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'php://memory'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` test_the_package_driver_creates_the_configured_logger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertAuditChannel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Level`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`Warning`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` test_configuration_changes_require_a_new_channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $before`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'logging.channels.audit.level'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'error'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertSame`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$before`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertAuditChannel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$before`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Level`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`Warning`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forgetChannel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $after`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertNotSame`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$before`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$after`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertAuditChannel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$after`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Level`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertAuditChannel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$before`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Level`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`Warning`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` test_the_same_factory_can_be_used_with_via`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'logging.channels.audit.driver'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'custom'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'logging.channels.audit.via'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` CreateAuditLogger`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forgetChannel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertAuditChannel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Log`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Level`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`Warning`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` private`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` assertAuditChannel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Logger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $channel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Level`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $level`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $logger`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $channel`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getLogger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertInstanceOf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Monolog`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$logger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertSame`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'acme-audit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$logger`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertCount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$logger`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getHandlers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $handler`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $logger`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getHandlers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`];`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertInstanceOf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`StreamHandler`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$handler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` $this`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assertSame`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$level`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$handler`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getLevel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`LogManager::get()`}),`은 채널 생성 중에 발생한 예외를 포착하고 emergency logger를 반환하는 경우가 있습니다. “예외가 발생하지 않았다”, “LoggerInterface였다”는 확인만으로는 목적한 채널이 구축되었다는 증거가 되지 않습니다. 위의 테스트에서는 Monolog의 이름, Handler, 로그 레벨도 확인해 폴백을 성공으로 오인하지 않도록 하고 있습니다. 생성 후의 기록 오류까지 같은 구조로 반드시 포착되는 것은 아닙니다.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`장기-유지보수에서-추가하는-검증`,children:`장기 유지보수에서 추가하는 검증`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`변경이나 사용 방법`}),_jsx(_components.th,{children:`확인할 것`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`tap`}),` 추가`]}),_jsx(_components.td,{children:`실제 팩토리가 반환하는 로거에 대해 기대하는 조정이 적용된다`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`stack에 포함`}),_jsx(_components.td,{children:`자식 채널의 Handler와 Processor가 포함되고, 재해석 시의 구성도 올바르다`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`출력 위치나 포맷 변경`}),_jsx(_components.td,{children:`실제 기록 내용, 권한, 로테이션 등을 별도의 검증 환경에서 확인한다`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`등록 시점 변경`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`log`}),`가 이미 해석된 상태여도 드라이버가 등록되고 채널을 생성할 수 있다`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Laravel 업데이트`}),_jsx(_components.td,{children:`콜백의 인수와 스코프, 보관 해제, emergency logger로의 폴백을 계속 확인한다`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`참조한-1차-정보`,children:`참조한 1차 정보`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/laravel/docs/blob/13.x/logging.md`,children:`Laravel 공식 문서: Logging`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/laravel/framework/blob/v13.39.0/src/Illuminate/Log/LogManager.php`,children:`Framework v13.39.0: LogManager의 생성·확장·보관 해제`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/laravel/framework/blob/v13.39.0/src/Illuminate/Log/Logger.php`,children:`Framework v13.39.0: Logger의 래핑과 메서드 전달`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/laravel/framework/blob/v13.39.0/src/Illuminate/Log/LogServiceProvider.php`,children:`Framework v13.39.0: LogServiceProvider의 singleton 등록`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/laravel/framework/blob/v13.39.0/src/Illuminate/Support/ServiceProvider.php`,children:`Framework v13.39.0: ServiceProvider::callAfterResolving`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/laravel/framework/blob/v13.39.0/src/Illuminate/Support/RebindsCallbacksToSelf.php`,children:`Framework v13.39.0: RebindsCallbacksToSelf`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/laravel/framework/blob/v13.39.0/tests/Integration/Log/LogManagerTest.php`,children:`Laravel 공식 테스트: LogManagerTest`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"패키지의 로그 채널 확장과 재해석","description":"Laravel 13의 custom·via와 LogManager::extend()를 구분해 사용하고, 채널 보관, forgetChannel(), 폴백을 고려해 로그 기능을 테스트합니다.","href":"/ko/advanced/package-logging"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"필요한 확장 포인트 선택하기","slug":"필요한-확장-포인트-선택하기","depth":2,"children":[]},{"title":"먼저 custom과 via로 팩토리를 공개하기","slug":"먼저-custom과-via로-팩토리를-공개하기","depth":2,"children":[]},{"title":"독자적인 드라이버 이름을 제공할 때는 extend를 사용하기","slug":"독자적인-드라이버-이름을-제공할-때는-extend를-사용하기","depth":2,"children":[]},{"title":"채널은 이름별로 보관된다","slug":"채널은-이름별로-보관된다","depth":2,"children":[{"title":"forgetChannel은 기존 참조를 갱신하지 않는다","slug":"forgetchannel은-기존-참조를-갱신하지-않는다","depth":3,"children":[]},{"title":"stack에 포함하려면 Monolog 호환 조작도 필요","slug":"stack에-포함하려면-monolog-호환-조작도-필요","depth":3,"children":[]}]},{"title":"목뿐만 아니라 실제 채널 해석을 검증하기","slug":"목뿐만-아니라-실제-채널-해석을-검증하기","depth":2,"children":[]},{"title":"장기 유지보수에서 추가하는 검증","slug":"장기-유지보수에서-추가하는-검증","depth":2,"children":[]},{"title":"참조한 1차 정보","slug":"참조한-1차-정보","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"narration":{"path":"ko/advanced/package-logging","locale":"ko","estimatedDurationSec":677},"subdomain":"invokable","siteName":"Knowledge of Laravel","title":"패키지의 로그 채널 확장과 재해석 - Knowledge of Laravel","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"jp":{"href":"/jp/advanced/package-logging","matchLevel":1},"en":{"href":"/en/advanced/package-logging","matchLevel":1},"de":{"href":"/de/advanced/package-logging","matchLevel":1},"es":{"href":"/es/advanced/package-logging","matchLevel":1},"fr":{"href":"/fr/advanced/package-logging","matchLevel":1},"it":{"href":"/it/advanced/package-logging","matchLevel":1},"ko":{"href":"/ko/advanced/package-logging","matchLevel":0},"nl":{"href":"/nl/advanced/package-logging","matchLevel":1},"zh-Hans":{"href":"/zh-CN/advanced/package-logging","matchLevel":1},"zh-Hant":{"href":"/zh-TW/advanced/package-logging","matchLevel":1}}},"lastModified":"2026-10-28T20:20:19.049Z","gitLastModified":"2026-10-28T20:20:00.000Z","originalFileLocation":"ko/advanced/package-logging.mdx","locale":"ko"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Laravel 13의 custom·via와 LogManager::extend()를 구분해 사용하고, 채널 보관, forgetChannel(), 폴백을 고려해 로그 기능을 테스트합니다.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Knowledge of Laravel\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"패키지의 로그 채널 확장과 재해석 - Knowledge of Laravel\">\u003cmeta data-mint-head property=\"og:description\" content=\"Laravel 13의 custom·via와 LogManager::extend()를 구분해 사용하고, 채널 보관, forgetChannel(), 폴백을 고려해 로그 기능을 테스트합니다.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Knowledge of Laravel\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://kawax.biz/ko/advanced/package-logging\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://invokable.mintlify.site/_mintlify/api/og/v2?division=%ED%8C%A8%ED%82%A4%EC%A7%80+%EA%B0%9C%EB%B0%9C\u0026amp;title=%ED%8C%A8%ED%82%A4%EC%A7%80%EC%9D%98+%EB%A1%9C%EA%B7%B8+%EC%B1%84%EB%84%90+%ED%99%95%EC%9E%A5%EA%B3%BC+%EC%9E%AC%ED%95%B4%EC%84%9D\u0026amp;description=Laravel+13%EC%9D%98+custom%C2%B7via%EC%99%80+LogManager%3A%3Aextend%28%29%EB%A5%BC+%EA%B5%AC%EB%B6%84%ED%95%B4+%EC%82%AC%EC%9A%A9%ED%95%98%EA%B3%A0%2C+%EC%B1%84%EB%84%90+%EB%B3%B4%EA%B4%80%2C+forgetChannel%28%29%2C+%ED%8F%B4%EB%B0%B1%EC%9D%84+%EA%B3%A0%EB%A0%A4%ED%95%B4+%EB%A1%9C%EA%B7%B8+%EA%B8%B0%EB%8A%A5%EC%9D%84+%ED%85%8C%EC%8A%A4%ED%8A%B8%ED%95%A9%EB%8B%88%EB%8B%A4.\u0026amp;theme=cef70bdc0dd1884481ab7c5d\u0026amp;signature=8213b60ef788d77a79bbfccac3e9bafac0a9b1dc545d4e0a9ae0bf3f535cb839\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"패키지의 로그 채널 확장과 재해석 - Knowledge of Laravel\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Laravel 13의 custom·via와 LogManager::extend()를 구분해 사용하고, 채널 보관, forgetChannel(), 폴백을 고려해 로그 기능을 테스트합니다.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://invokable.mintlify.site/_mintlify/api/og/v2?division=%ED%8C%A8%ED%82%A4%EC%A7%80+%EA%B0%9C%EB%B0%9C\u0026amp;title=%ED%8C%A8%ED%82%A4%EC%A7%80%EC%9D%98+%EB%A1%9C%EA%B7%B8+%EC%B1%84%EB%84%90+%ED%99%95%EC%9E%A5%EA%B3%BC+%EC%9E%AC%ED%95%B4%EC%84%9D\u0026amp;description=Laravel+13%EC%9D%98+custom%C2%B7via%EC%99%80+LogManager%3A%3Aextend%28%29%EB%A5%BC+%EA%B5%AC%EB%B6%84%ED%95%B4+%EC%82%AC%EC%9A%A9%ED%95%98%EA%B3%A0%2C+%EC%B1%84%EB%84%90+%EB%B3%B4%EA%B4%80%2C+forgetChannel%28%29%2C+%ED%8F%B4%EB%B0%B1%EC%9D%84+%EA%B3%A0%EB%A0%A4%ED%95%B4+%EB%A1%9C%EA%B7%B8+%EA%B8%B0%EB%8A%A5%EC%9D%84+%ED%85%8C%EC%8A%A4%ED%8A%B8%ED%95%A9%EB%8B%88%EB%8B%A4.\u0026amp;theme=cef70bdc0dd1884481ab7c5d\u0026amp;signature=8213b60ef788d77a79bbfccac3e9bafac0a9b1dc545d4e0a9ae0bf3f535cb839\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/invokable/pboFjibLpJPX3oCo/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Knowledge of Laravel\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://kawax.biz/ko/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ko/advanced/package-logging.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://kawax.biz/ko/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://kawax.biz/jp/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://kawax.biz/en/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://kawax.biz/de/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://kawax.biz/es/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://kawax.biz/fr/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"it\" href=\"https://kawax.biz/it/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"nl\" href=\"https://kawax.biz/nl/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://kawax.biz/zh-CN/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hant\" href=\"https://kawax.biz/zh-TW/advanced/package-logging\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://kawax.biz/jp/advanced/package-logging\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://kawax.biz/#organization\",\"name\":\"Knowledge of Laravel\",\"url\":\"https://kawax.biz\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/invokable/AuZ0xql2mAbUyZ99/logo/light.svg?fit=max\u0026auto=format\u0026n=AuZ0xql2mAbUyZ99\u0026q=85\u0026s=df0b7397202a6aa1c1f321620c5aa146\"}},{\"@type\":\"WebSite\",\"@id\":\"https://kawax.biz#website\",\"name\":\"Knowledge of Laravel\",\"url\":\"https://kawax.biz\",\"publisher\":{\"@id\":\"https://kawax.biz/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://kawax.biz/ko/advanced/package-logging#webpage\",\"url\":\"https://kawax.biz/ko/advanced/package-logging\",\"name\":\"패키지의 로그 채널 확장과 재해석\",\"description\":\"Laravel 13의 custom·via와 LogManager::extend()를 구분해 사용하고, 채널 보관, forgetChannel(), 폴백을 고려해 로그 기능을 테스트합니다.\",\"dateModified\":\"2026-10-28T20:20:00.000Z\",\"isPartOf\":{\"@id\":\"https://kawax.biz#website\"},\"breadcrumb\":{\"@id\":\"https://kawax.biz/ko/advanced/package-logging#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://kawax.biz/ko/advanced/package-logging#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"패키지 개발\",\"item\":\"https://kawax.biz/ko/advanced/package-development\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"패키지의 로그 채널 확장과 재해석\",\"item\":\"https://kawax.biz/ko/advanced/package-logging\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://kawax.biz/ko/advanced/package-logging#article\",\"headline\":\"패키지의 로그 채널 확장과 재해석\",\"name\":\"패키지의 로그 채널 확장과 재해석\",\"description\":\"Laravel 13의 custom·via와 LogManager::extend()를 구분해 사용하고, 채널 보관, forgetChannel(), 폴백을 고려해 로그 기능을 테스트합니다.\",\"url\":\"https://kawax.biz/ko/advanced/package-logging\",\"mainEntityOfPage\":{\"@id\":\"https://kawax.biz/ko/advanced/package-logging#webpage\"},\"dateModified\":\"2026-10-28T20:20:00.000Z\",\"publisher\":{\"@id\":\"https://kawax.biz/#organization\"},\"isPartOf\":{\"@id\":\"https://kawax.biz#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Knowledge of Laravel\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Knowledge of Laravel\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/ko/advanced/package-logging.md","siteName":"Knowledge of Laravel","nav":{"global":null,"languages":[{"language":"jp","default":true,"pages":[{"title":"jp","href":"/jp/advanced/package-logging"}]},{"language":"en","pages":[{"title":"en","href":"/en/advanced/package-logging"}]},{"language":"de","pages":[{"title":"de","href":"/de/advanced/package-logging"}]},{"language":"es","pages":[{"title":"es","href":"/es/advanced/package-logging"}]},{"language":"fr","pages":[{"title":"fr","href":"/fr/advanced/package-logging"}]},{"language":"it","pages":[{"title":"it","href":"/it/advanced/package-logging"}]},{"language":"ko","tabs":[{"tab":"My 패키지","pages":[{"title":"My 패키지","href":"/ko/packages/laravel-boost-copilot-cli"}]},{"tab":"튜토리얼","pages":[{"title":"튜토리얼","href":"/ko/introduction"}]},{"tab":"가이드","pages":[{"title":"가이드","href":"/ko/lifecycle"}]},{"tab":"심화 주제","groups":[{"group":"AI 개발","pages":[{"title":"Laravel에서 MCP 서버 만들기","href":"/ko/advanced/mcp-server"},{"title":"Boost의 커스텀 에이전트 만들기","href":"/ko/advanced/boost-custom-agent"},{"title":"AI SDK의 커스텀 프로바이더 만들기","href":"/ko/advanced/ai-sdk-custom-provider"},{"title":"Laravel AI SDK의 에이전트 미들웨어","href":"/ko/advanced/ai-sdk-agent-middleware"}]},{"group":"디자인 패턴","pages":[{"title":"Pipeline 패턴","href":"/ko/advanced/pipeline"},{"title":"Fluent 클래스","href":"/ko/advanced/fluent"},{"title":"Macroable 트레이트","href":"/ko/advanced/macroable"},{"title":"Conditionable 트레이트","href":"/ko/advanced/conditionable"},{"title":"InteractsWithTime 트레이트","href":"/ko/advanced/interacts-with-time"},{"title":"ForwardsCalls 트레이트","href":"/ko/advanced/forwards-calls"},{"title":"tap() 헬퍼와 Tappable 트레이트","href":"/ko/advanced/tap"},{"title":"once() 헬퍼의 내부 구현 — Once·Onceable·PreventsCircularRecursion","href":"/ko/advanced/once-helper"},{"title":"Dumpable 트레이트","href":"/ko/advanced/dumpable"},{"title":"Support Contracts (Arrayable / Jsonable / Htmlable / Responsable)","href":"/ko/advanced/support-contracts"},{"title":"Lottery 클래스","href":"/ko/advanced/lottery"},{"title":"컬렉션의 고차 메시지","href":"/ko/advanced/higher-order-messages"},{"title":"Collection Deep Dive","href":"/ko/advanced/collection-deep-dive"},{"title":"Illuminate\\Support\\Manager — 드라이버 시스템의 해부","href":"/ko/advanced/manager"},{"title":"PHP Reflection API","href":"/ko/advanced/php-reflection"},{"title":"PHP FFI","href":"/ko/advanced/ffi"},{"title":"PHP AST","href":"/ko/advanced/php-ast"}]},{"group":"패키지 개발","pages":[{"title":"Laravel 패키지 개발","href":"/ko/advanced/package-development"},{"title":"패키지 자동 감지의 내부 구조","href":"/ko/advanced/package-discovery"},{"title":"InteractsWithData 트레이트","href":"/ko/advanced/interacts-with-data"},{"title":"지연 서비스 프로바이더","href":"/ko/advanced/deferred-provider"},{"title":"패키지의 버전 호환성 관리","href":"/ko/advanced/package-versioning"},{"title":"GitHub Actions의 핀 고정과 보안","href":"/ko/advanced/github-actions-pinning"},{"title":"패키지의 CHANGELOG와 릴리스 관리","href":"/ko/advanced/package-changelog"},{"title":"Orchestra Testbench로 Laravel 패키지를 테스트하기","href":"/ko/advanced/package-testing"},{"title":"Testbench Workbench로 패키지 개발 진행하기","href":"/ko/advanced/package-workbench"},{"title":"GeneratorCommand — 커스텀 make: 명령어 구현","href":"/ko/advanced/generator-command"},{"title":"Laravel 스타터 킷 만드는 법","sidebarTitle":"스타터 킷 작성","href":"/ko/advanced/starter-kit-creation"},{"title":"패키지의 정적 해석 (PHPStan / Larastan)","href":"/ko/advanced/package-static-analysis"},{"title":"패키지 설정 병합과 캐시","href":"/ko/advanced/package-config-merging"},{"title":"패키지 마이그레이션의 배포와 업데이트","href":"/ko/advanced/package-migrations"},{"title":"패키지 뷰의 덮어쓰기와 업데이트","href":"/ko/advanced/package-views"},{"title":"패키지의 라우트 등록과 캐시","href":"/ko/advanced/package-routes"},{"title":"패키지 캐시와 optimize 통합","href":"/ko/advanced/package-optimization"},{"title":"패키지의 공개 에셋과 업데이트","href":"/ko/advanced/package-assets"},{"title":"패키지 번역의 덮어쓰기와 업데이트","href":"/ko/advanced/package-translations"},{"title":"패키지의 서비스 해석 후 훅","href":"/ko/advanced/package-service-resolution"},{"title":"패키지 진단 정보를 about에 추가하기","href":"/ko/advanced/package-about"},{"title":"패키지의 Artisan 명령어 등록과 의존성 해결","href":"/ko/advanced/package-commands"},{"title":"패키지의 이벤트 리스너 등록과 캐시","href":"/ko/advanced/package-events"},{"title":"패키지 서비스의 라이프사이클 설계","href":"/ko/advanced/package-service-lifetimes"},{"title":"패키지의 미들웨어 등록과 적용 범위","href":"/ko/advanced/package-middleware"},{"title":"패키지의 Blade 확장과 컴파일 캐시","href":"/ko/advanced/package-blade-extensions"},{"title":"패키지의 Storage 드라이버 등록과 재해석","href":"/ko/advanced/package-filesystem-drivers"},{"title":"패키지의 커스텀 알림 채널과 전송 검증","href":"/ko/advanced/package-notification-channels"},{"title":"패키지의 컨테이너 태그와 플러그인 집약","href":"/ko/advanced/package-container-tags"},{"title":"패키지의 HTTP 클라이언트와 테스트","description":"Laravel 13의 공유 HTTP Factory를 사용해 요청별 상태 분리, 서비스 등록, Http::fake()로 검증할 수 있는 API 클라이언트를 설계합니다.","href":"/ko/advanced/package-http-client"},{"title":"패키지의 로그 채널 확장과 재해석","href":"/ko/advanced/package-logging"},{"title":"패키지의 커스텀 캐시 스토어와 계약","description":"Laravel 13의 CacheManager와 Store 계약을 분석해 드라이버의 등록 시점, Repository에 의한 TTL 변환, 인스턴스 보관, 락 등의 지원 범위를 검증합니다.","href":"/ko/advanced/package-cache-drivers"},{"title":"패키지의 메일 트랜스포트 등록과 테스트","href":"/ko/advanced/package-mail-transports"},{"title":"패키지의 컨텍스트 속성과 의존성 해석","href":"/ko/advanced/package-contextual-attributes"},{"title":"패키지의 정기 태스크 등록과 유지보수","href":"/ko/advanced/package-scheduling"},{"title":"패키지의 커스텀 세션 드라이버","href":"/ko/advanced/package-session-drivers"},{"title":"패키지의 데이터베이스 연결 확장","href":"/ko/advanced/package-database-connections"},{"title":"패키지의 동적 관계 등록","href":"/ko/advanced/package-dynamic-relations"},{"title":"패키지의 문자열 유효성 검사 규칙 등록","sidebarTitle":"문자열 유효성 검사 규칙","href":"/ko/advanced/package-validation-extensions"},{"title":"패키지의 응답 Macro와 HTTP 계약","href":"/ko/advanced/package-response-macros"},{"title":"패키지의 서비스 데코레이션과 extend","href":"/ko/advanced/package-service-decoration"},{"title":"패키지의 인가 폴리시 등록과 재정의","href":"/ko/advanced/package-authorization"},{"title":"패키지의 Morph map과 저장 데이터의 호환성","href":"/ko/advanced/package-morph-maps"},{"title":"패키지의 큐 잡과 업데이트 시 호환성","href":"/ko/advanced/package-queue-jobs"},{"title":"패키지의 외부 프로세스 실행과 Process::fake","href":"/ko/advanced/package-processes"},{"title":"패키지의 브로드캐스트 채널 인가와 덮어쓰기","href":"/ko/advanced/package-broadcasting"},{"title":"패키지의 커스텀 UserProvider","href":"/ko/advanced/package-user-providers"}]},{"group":"애플리케이션 구조","pages":[{"title":"Laravel 11 이후의 애플리케이션 구조","href":"/ko/advanced/app-structure"},{"title":"구 구조에서 새 구조로의 이관 가이드","sidebarTitle":"이관 가이드","href":"/ko/advanced/app-structure-migration"},{"title":"Laravel 11 이후의 새 앱 구조 FAQ","sidebarTitle":"새 앱 구조 FAQ","href":"/ko/advanced/app-structure-faq"}]},{"group":"Laravel 13 신기능","pages":[{"title":"PHP 어트리뷰트","href":"/ko/advanced/php-attributes"},{"title":"컨트롤러 PHP 어트리뷰트","sidebarTitle":"컨트롤러 어트리뷰트","href":"/ko/advanced/controller-attributes"},{"title":"MigrationFailed 이벤트로 마이그레이션 실패 처리하기","href":"/ko/advanced/migration-failed-event"}]},{"group":"Eloquent 심화","pages":[{"title":"Eloquent Observers와 모델 이벤트","href":"/ko/advanced/eloquent-observers"},{"title":"Eloquent의 스코프","href":"/ko/advanced/eloquent-scopes"},{"title":"Eloquent의 커스텀 캐스트","href":"/ko/advanced/eloquent-casts"},{"title":"Eloquent Bootable Traits","href":"/ko/advanced/eloquent-bootable-traits"},{"title":"커스텀 피벗 모델과 chaperone","href":"/ko/advanced/eloquent-custom-pivot"},{"title":"Eloquent의 afterQuery와 조회 결과의 계약","sidebarTitle":"afterQuery와 결과 가공","href":"/ko/advanced/eloquent-after-query"}]},{"group":"유효성 검증 확장","pages":[{"title":"커스텀 검증 규칙","href":"/ko/advanced/custom-validation-rules"}]},{"group":"인증 확장","pages":[{"title":"커스텀 인증 가드 구현","href":"/ko/advanced/custom-auth-guard"},{"title":"Laravel Fortify와 스타터 킷","href":"/ko/advanced/fortify"}]},{"group":"보안","pages":[{"title":"레이트 리밋 커스터마이즈","href":"/ko/advanced/rate-limiting"}]},{"group":"큐","pages":[{"title":"큐 잡 실행 제어","href":"/ko/advanced/queue-job-control"},{"title":"큐 잡의 재시도 정책","href":"/ko/advanced/queue-retry-policy"}]},{"group":"테스트","pages":[{"title":"Pest를 이용한 고급 테스트","href":"/ko/advanced/testing-pest"}]},{"group":"실시간","pages":[{"title":"Mercure 브로드캐스트 드라이버의 내부 구조","href":"/ko/advanced/mercure-broadcasting"}]}]},{"tab":"블로그","pages":[{"title":"블로그","href":"/ko/blog/changelog/202610"}]}]},{"language":"nl","pages":[{"title":"nl","href":"/nl/advanced/package-logging"}]},{"language":"zh-Hans","pages":[{"title":"zh-Hans","href":"/zh-CN/advanced/package-logging"}]},{"language":"zh-Hant","pages":[{"title":"zh-Hant","href":"/zh-TW/advanced/package-logging"}]}]},"basePath":"","title":"패키지의 로그 채널 확장과 재해석 - Knowledge of Laravel","deploymentId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","buildId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","dynamics":["2bfc744e19"],"chunks":["NarrationPlayer-CFbGllAm.js","shallow-0VKqkSqN.js"]}