Depending on what you'd like to achieve you might be able to avoid custom code at all.
Use the JUL to SLF4J Bridge
The is a bridge available that hooks into java.util.Logging (JUL) and forwards all log events to SLF4J. Using the log output allows to use any SLF4J logging implementation (such as Logback or Log4j) for writing the combined log output for both logging APIs.
Using the JUL to SLF4J Bridge you'll get MDC support for free with any SLF4J implementation supporting it.
Write a JUL Extension
If you want to keep the logging systems separated then you would need to write a JUL extension which "reads" the MDC and output its values into the log. If you look into the SLF4J MDC class, it has a method for accessing all its values: org.slf4j.MDC.getCopyOfContextMap()
.
Keep in mind that the default JUL handler are very limited. Thus I think you would have to implement your own, which could then access the MDC. However, you need to check first that they are called from within the same thread.