Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
PHP istemci kitaplığı, günlük kaydı için PSR-3'e uygundur ve gRPC çağrıları için bir günlük kaydedici sağlar.
Mesajların kaydedildiği düzey, etkinliğin başarılı olup olmadığına bağlıdır.
Günlük mesajı
Başarı durumu
Başarısızlık durumu
Tek satırlık özet
BİLGİ
UYARI
Hata ayıklama mesajı (ör. sorgu çağırma)
HATA AYIKLA
BİLDİRİM
Günlük kaydını yapılandırma
Varsayılan olarak, kitaplık günlükçülerinin her biri Monolog
StreamHandler kullanarak burada belirtilen varsayılan ada sahip bir kanalda STDERR öğesine günlük kaydeder.
Varsayılan günlükçü için bazı seçenekleri google_ads_php.ini dosyasında yapılandırabilirsiniz:
[LOGGING] ; İsteğe bağlı günlük kaydı ayarları. logFilePath = "path/to/your/file.log"
logLevel = "INFO"
Günlüğe kaydetmeyi daha da özelleştirmeniz gerekiyorsa GoogleAdsClientBuilder içinde LoggerInterface uygulayan bir günlük kaydedici sağlayarak kendi günlük kaydedicinizi tamamen belirtebilirsiniz:
$googleAdsClient = (new GoogleAdsClientBuilder()) ... ->withLogger(new MyCustomLogger()) ->build();
[null,null,["Son güncelleme tarihi: 2025-08-27 UTC."],[[["\u003cp\u003eThe PHP client library uses PSR-3 for logging gRPC calls, with log levels varying based on success or failure of the event.\u003c/p\u003e\n"],["\u003cp\u003eBy default, logs are written to \u003ccode\u003eSTDERR\u003c/code\u003e using a Monolog StreamHandler with configurable options in the \u003ccode\u003egoogle_ads_php.ini\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eFor advanced customization, developers can implement the \u003ccode\u003eLoggerInterface\u003c/code\u003e and provide their own logger to the \u003ccode\u003eGoogleAdsClientBuilder\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eLogging is currently not supported for REST calls.\u003c/p\u003e\n"]]],[],null,["# Logging\n\n| **Note:** Logging is not supported for REST calls yet.\n\nThe PHP client library conforms to [PSR-3](http://www.php-fig.org/psr/psr-3) for\nlogging and provides a logger for gRPC calls.\n\nThe [level](//www.php-fig.org/psr/psr-3/#5-psrlogloglevel) at which messages are\nlogged depends on whether the event succeeded.\n\n| Log message | Success status | Failure status |\n|------------------------------------|----------------|----------------|\n| One-line summary | INFO | WARNING |\n| Debug message (e.g., call queries) | DEBUG | NOTICE |\n\n#### Configuring logging\n\nBy default, each of the library loggers logs to\n[`STDERR`](http://php.net/manual/en/features.commandline.io-streams.php) on a\nchannel with default name specified\n[here](https://github.com/googleads/google-ads-php/blob/HEAD/src/Google/Ads/GoogleAds/Lib/V21/GoogleAdsClientBuilder.php#L34)\nusing a [Monolog\nStreamHandler](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/StreamHandler.php).\n\nYou can configure some options for the default logger in the\n[`google_ads_php.ini`](https://github.com/googleads/google-ads-php/blob/HEAD/examples/Authentication/google_ads_php.ini)\nfile:\n\n\\[LOGGING\\] ; Optional logging settings. logFilePath = \"path/to/your/file.log\"\nlogLevel = \"INFO\"\n\nIf you need to further customize logging, you can specify your own logger\nentirely by providing a logger that implements the\n[`LoggerInterface`](//www.php-fig.org/psr/psr-3/) in\n[`GoogleAdsClientBuilder`](https://github.com/googleads/google-ads-php/blob/HEAD/src/Google/Ads/GoogleAds/Lib/V%0A21/GoogleAdsClientBuilder.php): \n\n $googleAdsClient = (new GoogleAdsClientBuilder())\n ...\n -\u003ewithLogger(new MyCustomLogger())\n -\u003ebuild();"]]