Logging and Debugging
Invocation Grid Worker Logger
A worker process will be decompressed to a temporary directory on ScaleOut hosts when it is deployed, located under the following path:
- Windows: %ProgramData%\ScaleOut Software\IG
- Linux: /usr/share/ScaleOut Software/IG
The Invocation Grid project template provides a Microsoft.Extensions.Logging
ILogger instance to PMI callbacks like the one implemented in Creating an Invocation Grid Project.
By default, this ILogger instance is configured to write log entries to rolling log files in IG's temporary directory on the ScaleOut hosts. The "ShoppingCartIG" worker used in these samples would have its log files written to this location:
- Windows: %ProgramData%\ScaleOut Software\IG\ShoppingCartIG\log20210727.txt
- Linux: /usr/share/ScaleOut Software/IG/ShoppingCartIG/log20210727.txt
These log files are the first place to check if an IG fails to launch or does not behave as expected.
ScaleOut Service Logging
Less commonly, the ScaleOut service itself may fail to launch an IG worker. This may be due to packaging errors, permission errors on the file system, or low-level problems with the platform. In this case, the service will write error information to the server logs.
- Windows: C:\Program Files\ScaleOut_Software\StateServer\soss_tlog0.txt
- Linux: /var/log/soss/soss_tlog0.txt
While the service log files contain a lot of internal diagnostics, all entries related to launching an IG will begin with the text
SOSS client lib: [L] IG Bootstrapper. For example:
21/07/30 17:09:31 - SOSS client lib: [L] IG Bootstrapper: Starting IG 'ShoppingCartIG' (2104209428) | File: dotnet | Args: ShoppingCartIG.dll | Local server port: 721 | WorkingDir: C:\ProgramData\ScaleOut Software\IG\ShoppingCartIG\dvipo5_xUgExRQDg
Debugging an IG
When running on a local development machine, use the -l flag with the
ig start command to instruct the local ScaleOut service to launch your IG project straight out of the project's Debug build folder. This skips the packaging and deployment step:
ig start -c "bootstrapGateways=localhost:721" -l
There are several ways to attach a debugger to the IG process:
- In Visual Studio's Debug menu, select the "Attach to Process..." item and select the
dotnet.exeprocess that hosts your worker from the list.
- Manually trigger a breakpoint by adding a call to System.Diagnostics.Debugger.Launch() in Program.Main().
Visual Studio must be launched as an administrator in order to attach a debugger to an Invocation Grid process.