Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net core Google.Cloud.Logging.V2:lognameoof_.net Core_Google Cloud Platform_Stackdriver - Fatal编程技术网

.net core Google.Cloud.Logging.V2:lognameoof

.net core Google.Cloud.Logging.V2:lognameoof,.net-core,google-cloud-platform,stackdriver,.net Core,Google Cloud Platform,Stackdriver,我正在编写一个.Net核心实用程序,它基本上是一个包装器,将消息/日志推送到GCP Stackdriver。在Google.cloud网站上也有对代码的引用 代码如下: using System; // Imports the Google Cloud Logging client library using Google.Cloud.Logging.V2; using Google.Cloud.Logging.Type; using System.Collections.Generic; us

我正在编写一个.Net核心实用程序,它基本上是一个包装器,将消息/日志推送到GCP Stackdriver。在Google.cloud网站上也有对代码的引用

代码如下:

using System;
// Imports the Google Cloud Logging client library
using Google.Cloud.Logging.V2;
using Google.Cloud.Logging.Type;
using System.Collections.Generic;
using Google.Api;

namespace GoogleCloudSamples
{
    public class QuickStart
    {
        public static void Main(string[] args)
        {
            // Your Google Cloud Platform project ID.
            string projectId = "YOUR-PROJECT-ID";

            // Instantiates a client.
            var client = LoggingServiceV2Client.Create();

            // Prepare new log entry.
            LogEntry logEntry = new LogEntry();
            string logId = "my-log";
            LogName logName = new LogName(projectId, logId);
            LogNameOneof logNameToWrite = LogNameOneof.From(logName);
            logEntry.LogName = logName.ToString();
            logEntry.Severity = LogSeverity.Info;
...

我的问题是这一行
lognameof logNameToWrite=lognameof.From(logName)-我收到一个错误,LogNameOneof,还有其他人能做到这一点吗?

我查看了github上最近对描述此配置的更改,似乎“LogNameOneof logNameToWrite=LogNameOneof.From(logName);”已被“logEntry.LogNameAsLogName=logName;”取代。这一变化可以从4月6日进行的最新调查中看到