Code scanning logs

You can view the output generated during code scanning analysis in GitHub.

The log and diagnostic information available to you depends on the method you use for code scanning in your repository. You can check the type of code scanning you're using in the Security and quality tab of your repository, by using the Tool drop-down menu in the alert list. To access this page, see Assessing code scanning alerts for your repository.

Logs on GitHub

You can see analysis and diagnostic information for code scanning run using CodeQL analysis on GitHub.

Summary metrics

Summary metrics include:

Source code extraction diagnostics

Extractor diagnostics only cover files that were seen during the analysis, metrics include:

You can see more detailed information about CodeQL extractor errors and warnings that occurred during database creation by enabling debug logging. See Logs are not detailed enough.

Diagnostic information for private package registries

Code scanning default setup workflows include a Setup proxy for registries step. When you are looking at a workflow run for default setup, you can expand this step to view the corresponding log. This contains information about which private package registry configurations were available to the analysis. Additionally, the log contains some diagnostic information which may help with troubleshooting if the private package registries are not successfully used by code scanning default setup. Look for the following messages:

If the output from the Setup proxy for registries step is as expected, but code scanning default setup is unable to successfully access dependencies in the private registries, you can obtain additional troubleshooting information. See Logs are not detailed enough.

For more information about giving code scanning default setup access to private registries, see Giving security features access to private registries.

Logs for the CodeQL CLI

If you're using the CodeQL CLI outside GitHub, you'll see diagnostic information in the output generated during database analysis. This information is also included in the SARIF results file.

Logs in VS Code

Progress and error messages are displayed as notifications in the bottom right corner of the Visual Studio Code workspace. These link to more detailed logs and error messages in the "Output" window.

You can access separate logs for the CodeQL extension, language server, query Server, or tests. The Language Server log contains more advanced debug logs for CodeQL language maintainers. You should only need these to provide details in a bug report.

To access these logs, see Accessing logs for CodeQL in Visual Studio Code.