Java LoggingAPI ??÷???
???????????? ???????[ 2014/10/28 11:34:44 ] ????????Java ???????
?????????????Log4j??jar????????????Щ??????????????JDK ?????Logging????????ЩС?????????????????Щ?????????????
????Log4j???????log4j.properties????????????????????????java logging???????logging.properties???????????????
????Logging.properties???λ??JDK???·???? jre/lib/???£?????????????:
handlers= java.util.logging.ConsoleHandler
.level= INFO
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
????????????????????????????????????У???????????á?
????handlers= java.util.logging.FileHandler?? java.util.logging.ConsoleHandler
????log????????????????????:
????java.util.logging.FileHandler.pattern = %h/java%u.log
?????????????ζ??壬?????java logging format api ???????á?
???????????????????????????????????????????????????????????Щ??????????????????????????????????Щ??????????????????Щ???á?
????com.jason.logger.LoggerDemo.level = ALL
????com.spt.logger.LoggerDemo.handlers = java.util.logging.FileHandler
????“com.spt.logger.LoggerDemo”??“Logger”??????????????????????Logger?????
????c????????У?????????:
????private static Logger log = Logger.getLogger(LoggerDemo.class.getName());
?????????????????logging ?????????????????:
????SEVERE (?????)
????WARNING
????INFO
????CONFIG
????FINE
????FINER
????FINEST (?????)
?????????????Щ??????????????????????о????log4j ???
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11