In log4j you can write your own classes that write logging messages somewhere (for example to your own logging system). In Java logging, you can do the same by implementing a java.util.logging.Handler. Lookup the documentation.