自己写appender,用NDC或MDC。 http://zhanglm.iteye.com/blog/611860看这个,权当参考, http://topic.csdn.net/u/20120618/14/c98974c3-44c5-40bd-9357-0bff389e0ff6.html