This project was born out of rage; I was fed up with the Java logging frameworks and decided to do something drastic about it.
This utility uses bytecode manipulation to remove all traces of Log4J and Commons Logging from any jar file or directory:
log()
andwarn()
becomesSystem.out.println()
error()
andfatal()
becomesSystem.err.println()
- Other statements are replaced with NOOP operations if possible. Note however, that there are some some advanced usage scenarios that WoodChipper doesn't know how to handle. But if your are only dealing with basic logging you should be fine.
log4j.properties
andcommons-logging.properties
are removed
You need maven installed.
git clone http://github.com/fred-o/woodchipper
cd woodchipper
mvn package
This will create woodchipper/target/woodchipper.jar
. Copy this jar
file to wherever its handy.
java -jar woodchipper.jar -i <input> -o <output>
The input argument should be either a jar file or the classpath that you want to purge. The output argument is optional; if left out it defaults to the same file/dir as the input.
This project is in an early stage and should by no means be considered stable. Right now it only handles Log4J and Commons Logging, 'support' for Java Logging (and possibly Slf4j) is planned. It would also be nice to have a maven plugin for WoodChipper.