2010-06-10 5 views
2

Atomikos가 Spring을 통해 구성되면 jta.properties 또는 transactions.properties 파일이 필요하지 않습니다. 그럼에도 불구하고, Atomikos는 stderr로 인쇄 추적 메시지와 함께 시작 : 그것은하지 않았다 Spring 설정처럼 보이게Atomikos 시작 오류 메시지를 제거하거나 숨기려면?

No properties path set - looking for transactions.properties in classpath... 
transactions.properties not found - looking for jta.properties in classpath... 
Failed to open transactions properties file - using default values 

- 분명히 모든 것이 잘하지만합니다. 누구든지 이걸 없애 버리는 방법을 알고 있습니까? 그래서 그것에 대해 1.000 번이나 물어 보지 않으시겠습니까?

stderr을 특정 구성 요소 또는 jar에서 리디렉션 할 수 있습니까?

답변

4

시스템 속성 com.atomikos.icatch.hide_init_file_path을 임의의 값으로 설정해야합니다. java 명령 행에서이 작업을 수행하십시오. 다음과 같이 받는다는에서는 확실한하려면 명령 줄 인자를 전달하여이 작업을 수행 :

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-surefire-plugin</artifactId> 
    <configuration> 
     <argLine>-Dcom.atomikos.icatch.hide_init_file_path=true</argLine> 
    </configuration> 
</plugin> 

는 업데이트 :

<bean id="atomikosSystemProps" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> 
    <property name="targetObject"> 
     <!-- System.getProperties() --> 
     <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> 
      <property name="targetClass" value="java.lang.System" /> 
      <property name="targetMethod" value="getProperties" /> 
     </bean> 
    </property> 
    <property name="targetMethod" value="putAll" /> 
    <property name="arguments"> 
     <!-- The new Properties --> 
     <util:properties> 
      <prop key="com.atomikos.icatch.hide_init_file_path">true</prop> 
     </util:properties> 
    </property> 
</bean> 

그냥 기억 : Spring 설정 파일 내에서,이 같은 속성을 설정할 수 있습니다 Atomikos beans가이 bean에 "의존"하도록하여 인스턴스화 순서가 맞도록하십시오.

1

아토 미코 스 로그는 SLF4J입니다. 이 종속성 만이 SLF4J로 로그하면 SLF4J의 NOP 바인더를 사용할 수 있으며 아무 것도 기록되지 않습니다. 아마 당신이 원하는 것이 아니라 아주 간단합니다.

특정 패키지의 로그 메시지를 무시하도록 SLF4J의 백엔드 로거를 구성 할 수 있습니다. SLF4J '백엔드 로거 logback와 예 : 내가 SLF4J 다른 백엔드 로거 here에 대한 자습서를 작성했습니다

<logger name="com.atomikos.something" level="OFF"/> 

.

+0

불행히도 Atomikos는 콘솔에 로깅하지 않고 stderr로 인쇄합니다. 내 의견으로는, 이것은 버그지만, 그 동안 나는 이것을 제거해야합니다! 감사. – HDave

+0

SLF4J의 간단한 구현을 사용하고 있습니까? [Javadoc] (http://slf4j.org/api/org/slf4j/impl/SimpleLogger.html "SimpleLogger") : INFO 이상의 레벨의 메시지를 콘솔에 기록하는 간단한 (직접적인) 구현체입니다 (System .err). – Espen