Google\Cloud\Logging\V2\LoggingServiceV2Client::deleteLog PHP Method

deleteLog() public method

The log reappears if it receives new entries. Sample code: try { $loggingServiceV2Client = new LoggingServiceV2Client(); $formattedLogName = LoggingServiceV2Client::formatLogName("[PROJECT]", "[LOG]"); $loggingServiceV2Client->deleteLog($formattedLogName); } finally { if (isset($loggingServiceV2Client)) { $loggingServiceV2Client->close(); } }
public deleteLog ( string $logName, array $optionalArgs = [] )
$logName string Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" `[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`, `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. For more information about log names, see [LogEntry][google.logging.v2.LogEntry].
$optionalArgs array { Optional. @type \Google\GAX\RetrySettings $retrySettings Retry settings to use for this call. If present, then $timeoutMillis is ignored. @type int $timeoutMillis Timeout to use for this call. Only used if $retrySettings is not set. }
    public function deleteLog($logName, $optionalArgs = [])
    {
        $request = new DeleteLogRequest();
        $request->setLogName($logName);
        $mergedSettings = $this->defaultCallSettings['deleteLog']->merge(new CallSettings($optionalArgs));
        $callable = ApiCallable::createApiCall($this->loggingServiceV2Stub, 'DeleteLog', $mergedSettings, $this->descriptors['deleteLog']);
        return $callable($request, [], ['call_credentials_callback' => $this->createCredentialsCallback()]);
    }