|
| 1 | +# Migrating Google Cloud Logging from V1 to V2 |
| 2 | + |
| 3 | +## How to upgrade |
| 4 | + |
| 5 | +Update your `google/cloud-logging` dependency to `^2.0`: |
| 6 | + |
| 7 | +``` |
| 8 | +{ |
| 9 | + "require": { |
| 10 | + "google/cloud-logging": "^2.0" |
| 11 | + } |
| 12 | +} |
| 13 | +``` |
| 14 | + |
| 15 | +## Changes |
| 16 | + |
| 17 | +### Client Options changes |
| 18 | + |
| 19 | +The following client options are removed/replaced with other options present in |
| 20 | +[`ClientOptions`][ClientOptions]. This was done to ensure client options are consistent across all |
| 21 | +Google Cloud clients. |
| 22 | + |
| 23 | +- `authCache` -> Moved to `credentialsConfig.authCache` |
| 24 | +- `authCacheOptions` -> Moved to `credentialsConfig.authCacheOptions` |
| 25 | +- `credentialsFetcher` -> Moved to `credentials` |
| 26 | +- `keyFile` -> Moved to `credentials` |
| 27 | +- `keyFilePath` -> Moved to `credentials` |
| 28 | +- `requestTimeout` -> Removed from client options and moved to a call option `timeoutMillis` |
| 29 | +- `scopes` -> Moved to `credentialsConfig.scopes` |
| 30 | +- `quotaProject` -> Moved to `credentialsConfig.quotaProject` |
| 31 | +- `httpHandler` -> Moved to `transportConfig.rest.httpHandler` |
| 32 | +- `authHttpHandler` -> Moved to `credentialsConfig.authHttpHandler` |
| 33 | +- `retries` -> Removed from client options and moved to call options `retrySettings.maxRetries` |
| 34 | + |
| 35 | +### Retry Options changes |
| 36 | + |
| 37 | +The retry options have been moved to use [`RetrySettings`][RetrySettings] in call options |
| 38 | +and function parameters. |
| 39 | + |
| 40 | +- `retries` -> Renamed to `retrySettings.maxRetries` |
| 41 | +- `maxRetries` -> Renamed to `retrySettings.maxRetries` |
| 42 | + |
| 43 | +[RetrySettings]: https://googleapis.github.io/gax-php/v1.26.1/Google/ApiCore/RetrySettings.html |
| 44 | + |
| 45 | +[ClientOptions]: https://googleapis.github.io/gax-php/v1.26.1/Google/ApiCore/Options/ClientOptions.html |
| 46 | + |
| 47 | +### `ConnectionInterface`, `Connection\Grpc`, and `Connection\Rest` are not used anymore. |
| 48 | + |
| 49 | +This is a major change, but one that we hope won't break any users. When the |
| 50 | +`LoggingClient` was created, behind the scenes a connection adapter was initialized. |
| 51 | + |
| 52 | +The Rest and Grpc connection classes (along with the `ConnectionInterface`) have been |
| 53 | +removed in favor of using the GAPIC generated clients directly. See `src/Connection/Gapic.php` |
| 54 | +for an example. |
| 55 | + |
| 56 | + |
0 commit comments