Sunday, July 29, 2012

Log4J and Spring Integration

Log4J and Spring Integration

while playing around with an idea from a client recently, i started to build a very simple Spring Integration based Log4J appender.  the idea behind this pattern is that if i can put log messages into Spring Integration, then i can leverage all of it's abilities to manage different channel handlers, processing, etc.

the inspiration for the solution came from these sites;

here's the end code;

the appender;

the gateway (Spring Integration)

dumb little test point

the spring integration config (for testing)

how to wire it up in the application context

Note: the application contexts are separate - so anything you need in the Spring Integration for the Logger has to be setup there, not in the 'root' context

No comments:

Post a Comment