示例#1
0
 public void JobEvent(string jobName, string message, string jobType, string error)
 {
     KuduEventGenerator.Log().WebJobEvent(
         _serverConfiguration.ApplicationName,
         NullToEmptyString(jobName),
         NullToEmptyString(message),
         NullToEmptyString(jobType),
         NullToEmptyString(error));
 }
示例#2
0
 public void SiteExtensionEvent(string method, string path, string result, string deploymentDurationInMilliseconds, string message)
 {
     KuduEventGenerator.Log().KuduSiteExtensionEvent(
         _serverConfiguration.ApplicationName,
         NullToEmptyString(method),
         NullToEmptyString(path),
         NullToEmptyString(result),
         NullToEmptyString(deploymentDurationInMilliseconds),
         NullToEmptyString(message));
 }
示例#3
0
 public void JobStarted(string jobName, string scriptExtension, string jobType, string siteMode, string error, string trigger)
 {
     KuduEventGenerator.Log().WebJobStarted(
         _serverConfiguration.ApplicationName,
         NullToEmptyString(jobName),
         NullToEmptyString(scriptExtension),
         NullToEmptyString(jobType),
         NullToEmptyString(siteMode),
         NullToEmptyString(error),
         NullToEmptyString(trigger));
 }
示例#4
0
 public void ProjectDeployed(string projectType, string result, string error, long deploymentDurationInMilliseconds, string siteMode, string vsProjectId = "")
 {
     KuduEventGenerator.Log().ProjectDeployed(
         _serverConfiguration.ApplicationName,
         NullToEmptyString(projectType),
         NullToEmptyString(result),
         NullToEmptyString(error),
         deploymentDurationInMilliseconds,
         NullToEmptyString(siteMode),
         NullToEmptyString(_settings.GetValue(SettingsKeys.ScmType)),
         NullToEmptyString(vsProjectId));
 }
示例#5
0
        public void Trace(string message, IDictionary <string, string> attributes)
        {
            // these are traced by TraceModule
            if (message == XmlTracer.IncomingRequestTrace ||
                message == XmlTracer.OutgoingResponseTrace)
            {
                return;
            }

            if (_requestMethod == HttpMethod.Get.Method)
            {
                // ignore normal GET request body
                string type = null;
                if (!attributes.TryGetValue("type", out type))
                {
                    return;
                }

                if (type != "error" && type != "warning")
                {
                    return;
                }
            }


            var strb = new StringBuilder();

            strb.AppendFormat("{0} ", message);

            // took from XMLtracer
            foreach (var attrib in attributes)
            {
                if (TraceExtensions.IsNonDisplayableAttribute(attrib.Key))
                {
                    continue;
                }

                strb.AppendFormat("{0}=\"{1}\" ", attrib.Key, attrib.Value);
            }

            KuduEventGenerator.Log().GenericEvent(ServerConfiguration.GetApplicationName(),
                                                  strb.ToString(),
                                                  _requestId,
                                                  string.Empty,
                                                  string.Empty,
                                                  string.Empty);
        }
示例#6
0
        public void DeprecatedApiUsed(string route, string userAgent, string method, string path)
        {
            path = NullToEmptyString(path);

            // Try not to send the same event (on the same path) more than once.
            if (DeprecatedApiPaths.ContainsKey(path))
            {
                return;
            }

            KuduEventGenerator.Log().DeprecatedApiUsed(
                _serverConfiguration.ApplicationName,
                NullToEmptyString(route),
                NullToEmptyString(userAgent),
                NullToEmptyString(method),
                path);

            DeprecatedApiPaths[path] = path;
        }
示例#7
0
        public void UnexpectedException(Exception ex, string method, string path, string result, string message, bool trace = true)
        {
            // this happen during unexpected situation and should not throw (masking the original exception)
            OperationManager.SafeExecute(() =>
            {
                if (ex.AbortedByKudu())
                {
                    return;
                }

                KuduEventGenerator.Log().KuduException(
                    _serverConfiguration.ApplicationName,
                    NullToEmptyString(method),
                    NullToEmptyString(path),
                    NullToEmptyString(result),
                    NullToEmptyString(message),
                    GetExceptionContent(ex, trace));
            });
        }
示例#8
0
        public void UnexpectedException(Exception exception, bool trace = true, string memberName = null, string sourceFilePath = null, int sourceLineNumber = 0)
        {
            // this happen during unexpected situation and should not throw (masking the original exception)
            OperationManager.SafeExecute(() =>
            {
                if (exception.AbortedByKudu())
                {
                    return;
                }

                KuduEventGenerator.Log().KuduException(
                    _serverConfiguration.ApplicationName,
                    string.Empty,
                    string.Empty,
                    string.Empty,
                    string.Empty,
                    GetExceptionContent(exception, trace, memberName, sourceFilePath, sourceLineNumber));
            });
        }