0
내 패키지 로거 대부분을 쉽게 잡아야하는보다 일반적인 애펜더를 사용하는 데 문제가 있습니다. 나는Wildfly 8.2.0 패키지 수준 로깅 범주
package com.mycompany.rest;
class RestService {
@Inject
private Logger log;
public void myLogTest(){
log.fine("My log line");
}
}
같은 코드 내 클래스를 정의 할 때, 꽤 괜찮아 다음
package com.mycompany.common.producers;
import java.util.logging.Logger;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
public class LoggerProducer {
@Produces
public Logger produceLogger(InjectionPoint injectionPoint){
return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
}
}
내 제조자로부터 주입 된 로거와 CDI 응용 프로그램이 어떤 클래스는 내가 모든 것을 정의 예상대로 작동합니다. BUT 일반 로거에 문제가 있습니다. 두 클래스가 있다고 가정 해 보겠습니다.
com.mycompany.rest.RestService; com.mycompany.rest.SecondRestService
내가
<logger category="com.mycompany.rest.RestService" use-parent-handlers="true">
<level name="FINE"/>
<handlers>
<handler name="MYCOMPANY"/>
</handlers>
</logger>
<logger category="com.mycompany.rest.SecondRestService" use-parent-handlers="true">
<level name="FINE"/>
<handlers>
<handler name="MYCOMPANY"/>
</handlers>
</logger>
모든 좋은 작품과 유사한 코드로, 제이보스의 펜더를 정의하지만이
를 구성하는 경우 나, 이해하고 싶습니다<logger category="com.mycompany.rest" use-parent-handlers="true">
<level name="FINE"/>
<handlers>
<handler name="MYCOMPANY"/>
</handlers>
</logger>
전혀 작동하지 않습니다. 내 필요 패키지 수준의 로거를 가지고있다 도와주세요!