Wenn Sie sich mit anderen Nutzern über unsere Produkte austauschen und Feedback geben möchten, können Sie dem offiziellen Google Ads-Discord-Kanal auf dem Server der
Google Advertising and Measurement Community beitreten.
Logging
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Anfragen, Antworten und Zusammenfassungsnachrichten, die an die Google Ads API gesendet werden, können mit Ihrem eigenen benutzerdefinierten Logger oder dem Standardlogger in der Clientbibliothek für Perl protokolliert werden.
Protokollebenen
Die Bibliothek protokolliert verschiedene Arten von Ereignissen auf verschiedenen Protokollebenen. Bei einer erfolgreichen API-Antwort wird die Zusammenfassung unter INFO
und die vollständige Anfrage und die Antworten unter DEBUG
protokolliert. Bei einer Anfrage, die zu einem API-Fehler geführt hat, wird die Zusammenfassungsnachricht unter WARN
und die vollständige Anfrage und Antwort unter INFO
protokolliert.
Logtyp |
Logname |
Erfolgsstufe |
Fehlerstufe |
ZUSAMMENFASSUNG |
Google.Ads.GoogleAds.Summary |
INFO |
WARN |
DETAILS |
Google.Ads.GoogleAds.Detail |
FEHLER BEHEBEN |
INFO |
Bei Teilausfällen werden die Details zum Teilausfall unter DEBUG
protokolliert.
Konfiguration
Die Clientbibliothek verwendet eine benutzerdefinierte Klasse für alle Logging-Zwecke. Sie wird über das Modul GoogleAdsLogger bereitgestellt. Diese Klasse bietet eine Standardkonfiguration, mit der sowohl Zusammenfassungs- als auch Detail-Logger in relative Dateien im Ordner logs
unter Ihrem Verzeichnis HOME
schreiben.
Die Standardkonfiguration kann jedoch überschrieben werden, indem Sie eine Datei log4perl.conf in Ihrem Verzeichnis HOME
bereitstellen.
Die Protokollierung kann mit den folgenden Methoden aktiviert/deaktiviert werden:
Aktiviert das Logging für beide Logger.
Google::Ads::GoogleAds::Logging::GoogleAdsLogger::enable_all_logging();
Deaktiviert das Zusammenfassungs-Logging.
Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_summary_logging();
Deaktiviert die detaillierte Protokollierung.
Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_detail_logging();
Sie können die Methoden der Klasse GoogleAdsLogger
direkt verwenden, um noch mehr Kontrolle darüber zu haben, wie Anfragen protokolliert werden.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-08-27 (UTC).
[null,null,["Zuletzt aktualisiert: 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."]]