로깅
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Google Ads API에 대한 요청, 응답, 요약 메시지는 자체 맞춤 로거 또는 Perl용 클라이언트 라이브러리의 기본 로거를 사용하여 로깅할 수 있습니다.
로그 수준
라이브러리는 다양한 유형의 이벤트를 다양한 로그 수준으로 로깅합니다. API 응답이 성공하면 요약이 INFO
에 로깅되고 전체 요청과 응답이 DEBUG
에 로깅됩니다. API 오류가 발생한 요청의 경우 요약 메시지는 WARN
에 기록되고 전체 요청과 응답은 INFO
에 기록됩니다.
로그 유형 |
로그 이름 |
성공 수준 |
실패 수준 |
요약 |
Google.Ads.GoogleAds.Summary |
정보 |
WARN |
상세정보 |
Google.Ads.GoogleAds.Detail |
디버그 |
정보 |
부분 실패의 경우 부분 실패 세부정보가 DEBUG
에 로깅됩니다.
구성
클라이언트 라이브러리는 모든 로깅 목적으로 맞춤 클래스를 사용하며 GoogleAdsLogger 모듈을 통해 노출됩니다. 이 클래스는 요약 로거와 세부정보 로거가 모두 HOME
디렉터리 아래의 logs
폴더에 있는 상대 파일에 로깅하는 기본 구성을 제공합니다.
하지만 HOME
디렉터리에 log4perl.conf 파일을 제공하여 기본 구성을 재정의할 수 있습니다.
로깅은 다음 방법을 사용하여 사용 설정/사용 중지할 수 있습니다.
두 로거 모두에 로깅을 사용 설정합니다.
Google::Ads::GoogleAds::Logging::GoogleAdsLogger::enable_all_logging();
요약 로깅을 사용 중지합니다.
Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_summary_logging();
세부정보 로깅을 사용 중지합니다.
Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_detail_logging();
GoogleAdsLogger
클래스의 메서드를 직접 사용하여 요청이 로깅되는 방식을 더욱 세밀하게 제어할 수 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[null,null,["최종 업데이트: 2025-08-27(UTC)"],[[["\u003cp\u003eThe Google Ads API client library for Perl allows logging of requests, responses, and summaries using a custom or default logger.\u003c/p\u003e\n"],["\u003cp\u003eLogging levels include \u003ccode\u003eINFO\u003c/code\u003e, \u003ccode\u003eDEBUG\u003c/code\u003e, and \u003ccode\u003eWARN\u003c/code\u003e, used to categorize different event types like successes, failures, and partial failures.\u003c/p\u003e\n"],["\u003cp\u003eThe default logger configuration saves logs to the \u003ccode\u003elogs\u003c/code\u003e folder in your home directory, which can be customized by providing a \u003ccode\u003elog4perl.conf\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eLogging can be controlled through the \u003ccode\u003eGoogleAdsLogger\u003c/code\u003e module, allowing for enabling/disabling logging or more advanced customization.\u003c/p\u003e\n"]]],[],null,["# Logging\n\nRequests, responses, and summary messages made to the Google Ads API can be\nlogged with your own custom logger or the default logger in the client library\nfor Perl.\n\nLog Levels\n----------\n\nThe library will log different types of events to different log levels. On a\nsuccessful API response, the summary will be logged at `INFO`, and the full\nrequest and responses will be logged at `DEBUG`. On a request that resulted in\nan API error, the summary message will be logged at `WARN` and the full request\nand response will be logged at `INFO`.\n\n| Log type | Log name | Success level | Failure level |\n|----------|------------------------------|---------------|---------------|\n| SUMMARY | Google.Ads.GoogleAds.Summary | INFO | WARN |\n| DETAIL | Google.Ads.GoogleAds.Detail | DEBUG | INFO |\n\nFor partial failures, the partial failure details will be logged at `DEBUG`.\n\nConfiguration\n-------------\n\nThe client library uses a custom class for all logging purposes and is exposed\nthrough the [GoogleAdsLogger](https://github.com/googleads/google-ads-perl/blob/HEAD/lib/Google/Ads/GoogleAds/Logging/GoogleAdsLogger.pm)\nmodule. This class provides a default configuration that both summary and detail\nloggers will log to relative files in the `logs` folder under your `HOME` directory.\nBut the default configuration can be overridden by providing a\n[log4perl.conf](https://github.com/googleads/google-ads-perl/blob/HEAD/log4perl.conf)\nfile in your `HOME` directory.\n\nLogging can be enabled/disabled using the following methods:\n\n- Enables logging for both loggers.\n\n Google::Ads::GoogleAds::Logging::GoogleAdsLogger::enable_all_logging();\n\n- Disables the summary logging.\n\n Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_summary_logging();\n\n- Disables the detail logging.\n\n Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_detail_logging();\n\nYou can use the methods of the `GoogleAdsLogger` class directly for even more\ncontrol over how requests are logged."]]