cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Wulff <owu...@talend.com>
Subject LogUtils and MDC
Date Sat, 18 Jun 2011 11:59:56 GMT
Hi there

Analyzing log files of a CXF based application can be difficult because there is too less
context in the log4j log.

I was thinking in writing a custom CXF interceptor which writes some context information into
the MDC. MDC is supported by SLF4J and Log4J but not from JUL. Context information could be
WSDL service name, Porttype name, operation, user and maybe other.

This interceptor could be configured what information to write into the MDC.

Initially I wanted to implement that within the application but I think it's an added value
to contribute this to CXF directly.

The question now is how to integrate this...

Right now, I see two options

1) use SLF4J to set the MDC (SLF4J supports log4j and logback which support MDC)
I don't like that we use another logging api within CXF code

2) or extend the LogUtils class to get/set the MDC which delegates it then to Log4J or SLF4J
We had to make changes to one of the common classes.

What do you think?

Thanks
Oli


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message