Log4j is a logging package written in Java. Log4j allows you to log to a file, a java.io.Writer, a remote server, or a syslog daemon. The package is designed so that log statements can remain in shipped code without incurring a high performance cost. One distinctive feature of log4j is the notion of hierarchical loggers.