How to obtain Qodana logs
Our support team, in some cases, may ask you to provide logs for investigation. Here is a guide on how to obtain them from different environments.
Local run
(taken from https://www.jetbrains.com/help/qodana/docker-image-configuration.html#docker-config-reference-overview-logs)
Docker
You can mount the $(pwd)/.qodana/results/ directory to the /data/results directory of the Docker image:
docker run \
-v $(pwd):/data/project/ \
-v $(pwd)/.qodana/results/:/data/results \
-e QODANA_TOKEN="<cloud-project-token>" \
jetbrains/qodana-<linter>
Once the Qodana run is complete, you can view log files in the $(pwd)/.qodana/results/ directory.
Qodana CLI
After running Qodana, in the project root run the qodana show -d command for opening the directory containing log files. Share the log folder.
CI/CDs:
GitHub Actions
set upload-result to true in the Qodana job config in the GitHub Action yaml file:
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2024.2
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
with:
upload-result: true
Then run your Qodana job again. It will produce a qodana-report artifact, share the log folder from it.
Azure DevOps
set upload-result to true in the Qodana job config in azure-pipelines.yml file:
- task: QodanaScan@2024
env:
QODANA_TOKEN: $(QODANA_TOKEN)
inputs:
uploadResult: true
Then run your Qodana job again. It will produce a qodana-report artifact, share the log folder from it.
GitLab
To obtain logs from Qodana on GitLab, add to the qodana command in the script section: --results-dir=$CI_PROJECT_DIR/.qodana/results, i.e.
script:
- qodana --save-report --results-dir=$CI_PROJECT_DIR/.qodana/results
And expose the results directory as an artifact. E.g.:
qodana:
...
artifacts:
paths:
- .qodana/results/
expose_as: 'Qodana report'
Then run your Qodana job, and it should produce a Qodana report artifact that you can download. Share the log folder from it.
Please sign in to leave a comment.