# Debugging Endpoints

Tips for testing and troubleshooting your endpoint code.

# Using the Shell

Before putting code into an endpoint, test your graph queries and logic in the Shell. The environment is very similar, allowing you to iterate quickly.

# Logging

Use Logger.LogInformation and Logger.LogDebug liberally. You can view these logs in the workspace's log viewer to see exactly what's happening during execution.

# Return Intermediate Data

During development, change your endpoint's return type to return raw data or objects so you can inspect them in the browser or via curl.

# Check CancellationToken

For long-running endpoints, always check CancellationToken.IsCancellationRequested or call ThrowIfCancellationRequested() to ensure the endpoint stops if the user disconnects or the request times out.