As said SLF4j is only a logging API/interface, it does not directly replace log4j which is a complete logging framework (with configurable appenders, filters, …) but replaces Commons Logging as a framework-agnostic API for logging.
SLF4j can be configured to use log4j as a logging backend so they can work together. However a quite closely related project is logback (http://logback.qos.ch/). Logback is a replacement for Log4j: it is a logging framework (as Log4j) but it uses natively the SLF4j API.
SLF4j has some useful companion JAR files which can be used to make other logging API delegate to the SLF4j API : jcl-over-slf4j (replacement API compatible with commons logging), jul-to-slf4j (for java.util.logging), log4j-over-slf4j (API compatible with log4j). Using those you can have a lot of logging API talk forward to SLF4j (useful for third-party JARs) so that you have a single logging framework handling all logs.
The SLF4j API supports the "MDC" feature of log4j/logback (which is not availablog in the Commons Logging API) so you can use this feature in your project without depending on a specific framework. You probably can replace log4j calls with SLF4j calls in your code (unless your using other features such as NDC) but you will probably still want to ship log4j or slf4j as a backend for the SLF4j API.