Logger之简单入门

本文介绍了Java中自带的日志系统的基本概念,包括日志级别、Logger类的作用、Handler类及Formatter类的应用等,并提供了几个子类的具体说明。

Java 中自带的日志系统,今天抽空了解了一点,算是入了门,所以将自己的一些心得记录下来,以备日后查看,有兴趣的朋友,看到此文章,觉得有错误或需要添加的地方,请在下方评论留言,大家可以共同进步,谢谢:)

Java中关于日志系统的API,在 java.util.logging 包中,在这个包中,Logger类很重要。

Logger类是用来记录 某个级别的日志消息:

  级别共分为以下几类,从上倒下,级别依次下降:

    SEVERE(严重)------级别最高

    WARNING(警告)

    INFO

    CONFIG

    FINE

    FINER

    FINEST------最低值

    另外,还有一个级别 OFF,可以用来关闭日志;使用级别 ALL,启用所有消息的日志记录。(日志消息级别,可以查看 java.util.logging.Level类)

    具体记录日志的方法,查看此类的API文档,在此就不详述了。

  Logger记录的日志消息会被转发到已注册的Handler对象,handler对象可以将消息发送到:控制台,文件,网络等等。

 

Handler类(抽象类):主要用于转发日志消息

  Hanlder类下有2个子类:MemoryHandler、StreamHandler。

  StreamHandler下有3个子类:ConsoleHandler(将日志消息打印到控制台)、FileHandler(将日志消息输出到文件)、SocketHandler(将日志发送到网络中的某个主机)。具体详情,查看API文档。

 

Formatter类(抽象类):主要用于格式化日志记录消息。

转载于:https://www.cnblogs.com/pengpeng1208/p/8529623.html

Home » Learn more about the DC1100 Air Quality Monitor Learn more about the DC1100 Air Quality Monitor Dylos Corporation's DC1100 Air Quality Monitor is the first monitor on the market that has been developed and tested for consumer use. Up until now, the only particulate air quality monitors available for purchase were the extremely high priced units that were sold to hospitals, laboratories, clean room facilities, etc. The DC1100, on the other hand, was designed expressly to meet the needs of the home or office environment at an affordable price. •True Laser Particle Counter •Counts individual particles •Sizes small and large particles •Immediate response to changing environment •Up to 30 days of stored history data The DC1100 Air Quality Monitor provides you with the necessary information for you to assess whether or not your indoor air is clean. It helps you stay proactive in the health of your family and if used in conjunction with the tips provided, you will be able to make sure that you are doing all that you can to keep the air your family breathes clean. All you need to do is simply plug it in and turn it on. The DC1100 will configure itself to continuously count the airborne particles in your home. The DC1100 will let you know if the steps you are taking to improve your air quality are really working or not. The DC1100 will let the consumer know if an $800 air purifier works any better than a $200 one in their home. This will save the consumer money by taking the guesswork out of improving air quality. To assist the consumer in these efforts the DC1100 stores up to 30 days of air quality history for review.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值