> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/developer-tools/snyk-cli/commands/log4shell.md).

# Log4shell

The snyk log4shell command that scans for the Log4Shell vulnerability

## Usage

`snyk log4shell`

## Description

The `snyk log4shell` command finds traces of the Log4J library that are affected by the Log4Shell vulnerability [CVE-2021-44228](https://security.snyk.io/vuln/SNYK-JAVA-ORGAPACHELOGGINGLOG4J-2314720)

The command finds traces of the Log4J library even if it is not declared in the manifest files (such as `pom.xml` or `build.gradle`).

## Managed projects

To test for Log4Shell vulnerabilities in Java projects using their package manager manifest files, use the `snyk test` command. See the [test command help](/developer-tools/snyk-cli/commands/test.md) (`snyk test --help`) and [Java and Kotlin](https://docs.snyk.io/supported-languages-package-managers-and-frameworks/java-and-kotlin)

To test unmanaged files, use `snyk test --scan-all-unmanaged`

See the Maven options section of the [test command help](/developer-tools/snyk-cli/commands/test.md); `snyk test --help`

## Exit codes

Possible exit codes and their meaning:

**0**: success (scan completed), Log4Shell not found\
**1**: action\_needed (scan completed), Log4Shell found\
**2**: failure, try to re-run the command. Use `-d` to output the debug logs.

## Debug

Use the `-d` option to output the debug logs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snyk.io/developer-tools/snyk-cli/commands/log4shell.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
