태그 보관물: java.util.logging

restfb 로그 console에 찍히는거 제거..

restfb 라이브러리가 로그를 log4j에서 java.util.logging 패키지로 바꿨네요.. ^^;; log4j에 대한 의존을 하지 않아서 깔끔하긴 한데.. 모랄까.. 실제적(?)이지 않다고 해야 하나? restfb에서 log를 console에 찍히지 않게 하려면 아래의 logging.properties 파일을 만들고 java를 실행할 때, 옵션으로 설정파일을 읽어주면 됩니다.

ex) java -Djava.util.logging.config.file=./conf/logging.properties -Xms128m -Xmx1024m -server -jar xxx-xxx-server.jar
logging.properties

############################################################
# logging.properties
# usage : java -Djava.util.logging.config.file=logging.properties
############################################################

handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
.level= ALL
########### level ##########
# SEVERE
# WARNING
# INFO
# CONFIG
# FINE
# FINER
# FINEST (최저치)
#############################

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

# default file output is in user’s home directory.
java.util.logging.ConsoleHandler.level = WARNING
java.util.logging.FileHandler.pattern = /var/justin/mywho-livefeed-qserver/restfb_%u.log
# 10240000 == 10M, 102400000 == 100M, 1024000000 == 1G
java.util.logging.FileHandler.limit = 1024000000
java.util.logging.FileHandler.count = 5
java.util.logging.FileHandler.append = true
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = SEVERE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
com.restfb = INFO