Esempio n. 1
0
        /// <inheritdoc />
        public virtual void ActionMethodInvocationRequestStarted(IGraphMethod action, IDataRequest request)
        {
            if (!this.IsEnabled(LogLevel.Trace))
            {
                return;
            }

            var entry = new ActionMethodInvocationStartedLogEntry(action, request);

            this.LogEvent(LogLevel.Trace, entry);
        }
Esempio n. 2
0
        public void ActionMethodInvocationStartedLogEntry()
        {
            var server = new TestServerBuilder()
                         .AddGraphType <LogTestController>()
                         .Build();
            var graphMethod  = TemplateHelper.CreateActionMethodTemplate <LogTestController>(nameof(LogTestController.ExecuteField2)) as IGraphMethod;
            var package      = server.CreateFieldContextBuilder <LogTestController>(nameof(LogTestController.ExecuteField2));
            var fieldRequest = package.FieldRequest;

            var entry = new ActionMethodInvocationStartedLogEntry(graphMethod, fieldRequest);

            Assert.AreEqual(LogEventIds.ControllerInvocationStarted.Id, entry.EventId);
            Assert.AreEqual(fieldRequest.Id, entry.PipelineRequestId);
            Assert.AreEqual(graphMethod.Parent.InternalFullName, entry.ControllerName);
            Assert.AreEqual(graphMethod.Name, entry.ActionName);
            Assert.AreEqual(graphMethod.Route.Path, entry.FieldPath);
            Assert.AreEqual(graphMethod.ObjectType.ToString(), entry.SourceObjectType);
            Assert.AreEqual(graphMethod.IsAsyncField, entry.IsAsync);
            Assert.IsNotNull(entry.ToString());
        }