문제

I want to use LevelChangePropagator as logback contextListener, as described in the logback manual. However in my project logback is configured using groovy, and there's nothing in the official documentation about configuring contextListener in groovy. Logback provides a tool to translate xml configuration into a groovy configuration. I tried it, but it just skipped the contextListener part.

I've found exactly one answer to my question in the logback mailing lists, but solution doesn't seem to be working for me.

EDIT:
I've created an issue in logback JIRA about missing documentation: http://jira.qos.ch/browse/LOGBACK-979. Still, maybe someone knows the answer?

도움이 되었습니까?

해결책

Add this to logback.groovy:

import ch.qos.logback.classic.jul.LevelChangePropagator

def lcp = new LevelChangePropagator()
lcp.context = context
lcp.resetJUL = true
context.addListener(lcp)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top