내용으로 건너뛰기
권남
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
추적:
java:log4j:async
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== 비동기 로깅 ====== * [[http://ricardozuasti.com/2009/asynchronous-logging-with-log4j/|Asynchronous logging with log4j]] * [[http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/AsyncAppender.html|AsyncAppender]] * [[http://knight76.tistory.com/entry/log4j-AsyncAppender-%EC%82%AC%EC%9A%A9%EC%8B%9C-%EC%9C%A0%EC%9D%98%EC%82%AC%ED%95%AD|log4j AsyncAppender 사용시 유의사항]] * convertion pattern에서 ''%F:%L'' 사용시 ?:? 로 발생할 수 있다. * ''<param name="locationInfo" value="true"/>'' 를 추가해야 한다. - 부하 발생. <code xml> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" > <log4j:configuration> <appender name="stdout" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{yyyy/MM/dd HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> <param name="BufferSize" value="500"/> <param name="locationInfo" value="true"/> <appender-ref ref="stdout"/> </appender> <root> <priority value="error"></priority> <appender-ref ref="ASYNC"/> </root> </log4j:configuration> </code> * 주의 할 점들 * 중복 로그가 발생하면, 로거에 ''additivity'' 속성을 ''false''로 지정해야 한다. * The BufferSize parameter of the AsyncAppender defines the number of entries that will be stored in memory to let the actual appender catch up flushing them to their final destination. If this buffer fills up, the logging will switch to a synchronous mode until buffer space becomes available, potentially becoming a performance issue. Make sure this buffer is big enough, taking into account the IO speed and number of log entries generated by your application. * You can add the Blocking parameter to the AsyncAppender definition in your config file, if you set it to false (the default value is true) when the buffer fills up, the appender will discard log events until new buffer space becomes available. This can be unacceptable in applications where logging information is critical, but on the other hand can be very desirable where performance is a critical factor.
java/log4j/async.txt
· 마지막으로 수정됨: 2013/04/11 10:12 저자
kwon37xi
문서 도구
문서 보기
이전 판
역링크
맨 위로