다음 예는 Java 런타임 환경의 로그 수준을 설정하는 데 사용되는 JRE_DIRECTORY/lib/logging.properties 파일에 로깅 이름 공간 및 수준을 설정하는 방법을 나타냅니다. 이 JRE를 사용하는 모든 응용 프로그램에는 동일한 로깅 구성이 있습니다. 다음의 예제 구성은 javax.jms.connection 이름 공간에 대해 로깅 수준을 INFO로 설정하며 출력을 java.util.logging.ConsoleHandler에 기록할 것을 지정합니다.
#logging.properties file. # "handlers" specifies a comma separated list of log Handler # classes. These handlers will be installed during VM startup. # Note that these classes must be on the system classpath. # By default we only configure a ConsoleHandler, which will only # show messages at the INFO and above levels. handlers= java.util.logging.ConsoleHandler # Default global logging level. # This specifies which kinds of events are logged across # all loggers. For any given facility this global level # can be overriden by a facility-specific level. # Note that the ConsoleHandler also has a separate level # setting to limit messages printed to the console. .level= INFO # Limit the messages that are printed on the console to INFO and above. java.util.logging.ConsoleHandler.level = INFO java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # The logger with javax.jms.connection name space will write # Level.INFO messages to its output handler(s). In this configuration # the ouput handler is set to java.util.logging.ConsoleHandler. javax.jms.connection.level = INFO