elsa-workflows / elsa-workflows/elsa-core
Workflow and Activities Logging Documentation
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Documentation Improvement Request
### Documentation Issue Overview
I'm reading Elsa 3 (and Elsa 2 docs) and there is no information related to logs except configuring their scope.
### Proposed Documentation Changes
It would be great to explain new user on how to see other than error logs about failed activities, especially some custom logs when scripting is used (via C# or JS in Elsa Studio)
### Impact of Changes
**Explain the potential impact**
Usually starting with a new framework or doing PoC a lot of things go wrong, and two things are very much needed - Logging and when logging is not enough Debugging. It could simplify work with a new framework or library and also reduce mental leap required to use it.
### Additional Context
At the moment I started with Elsa 3 (Server + studio) and doing a simple tutorial from documentation of Elsa 3 to define a workflow via Studio UI. As in docs there is an HttpEndpoint to get userId via url path, and next activity is SetVariable. Inside (accordingly docs) I have C# expression: return Variables.RouteData["userid"];
It fails with:
Object reference not set to an instance of an object.
--
StackTrace | | at Submission#4.<>d__0.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken) at Elsa.CSharp.Services.CSharpEvaluator.EvaluateAsync(String expression, Type returnType, ExpressionExecutionContext context, ExpressionEvaluatorOptions options, Func`2 configureScriptOptions, Func`2 configureScript, CancellationToken cancellationToken) at Elsa.CSharp.Expressions.CSharpExpressionHandler.EvaluateAsync(Expression expression, Type returnType, ExpressionExecutionContext context, ExpressionEvaluatorOptions options) at Elsa.Expressions.Services.ExpressionEvaluator.EvaluateAsync(Expression expression, Type returnType, ExpressionExecutionContext context, ExpressionEvaluatorOptions options) at Elsa.Extensions.ActivityExecutionContextExtensions.EvaluateInputPropertyAsync(ActivityExecutionContext context, ActivityDescriptor activityDescriptor, InputDescriptor inputDescriptor) at Elsa.Extensions.ActivityExecutionContextExtensions.EvaluateInputPropertiesAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.DefaultActivityInvokerMiddleware.EvaluateInputPropertiesAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.DefaultActivityInvokerMiddleware.InvokeAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.NotificationPublishingMiddleware.InvokeAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.ExecutionLogMiddleware.InvokeAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.ExceptionHandlingMiddleware.InvokeAsync(ActivityExecutionContext context)
I'm not sure what is wrong exactly but when I hardcode "return 2;" pipeline works fine.
I wanted to understand what is exactly null and added code to log Variables data in a loop (via Console.WriteLine(...)) but surprisingly I don't see any logs in ASP.NET application console.
Then I tried to set log level to Debug in appsettings but still not logs except beforementioned error log.
Having no docs about logging messages and observing those logs this task goes from "entry level getting started" to "I'm lost" feeling. Maybe it's something obvious tho, but so far I'm blind to understand what is expected from me to show custom logged messages.
Contributor guide
Assessment
This issue has not been assessed yet.