Ehcache 1.5.0 User Guide - Logging 日志(10)
2009-08-14 10:45
344 查看
10、Logging 日志
10.1 Java Util Logging
As of 1.6, Ehcache uses the built-in Java Util library ("j.u.l") for logging.1.6版本以前使用java util库内置的记录日志。
10.2 Working with SL4J (使用SL4J工作)
Simple Logging Facade For Java (SL4J) is an increasingly popular replacement for commons-logging.(java的简单的日志门面是一个日益流行替代commons-logging的替代品。)
You can still log via SL4J using the SLF4JBridgeHandler. See http://www.slf4j.org/legacy.html According to http://blog.cn-consult.dk/2009/03/bridging-javautillogging-to-slf4j.html this will install an extra logger. To stop j.u.l. from logging at all .
To remove j.u.l logging all together use the following code snippet.
(你可以使用SLF4JBridgeHandler 对象通过SL4J记录日志。查看See http://www.slf4j.org/legacy.html。
依照http://blog.cn-consult.dk/2009/03/bridging-javautillogging-to-slf4j.html安装一个额外的日志。停止使j.u.l记录日志。
使用下面的代码片段移除j.u.l记录日志。)
java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger("");
Handler[] handlers = rootLogger.getHandlers();
for (int i = 0; i < handlers.length; i++) {
rootLogger.removeHandler(handlers[i]);
}
SLF4JBridgeHandler.install();
10.3 Recommended Logging Levels(推荐的日志级别)
Ehcache seeks to trade off informing production support developers or important messages and cluttering the log.SEVERE JDK logging SEVERE messages should not occur in normal production and indicate that action should be taken.
(Ehcahe 努力在支持开发者的产品信息或重要信息和简洁的日志间寻找平衡。
记录严格的信息SEVERE JDK不应该在出现正常生产系统并指示应该采取行动。)
WARN JDK logging WARN messages generally indicate a configuration change should be made or an unusual event has occurred.
(WARN JDK 记录警告信息一般指示需要修改配置或者发生了不寻常的事件。)
FINE JDK logging FINE messages are for development use. All DEBUG level statements are surrounded with a guard so that they are not executed unless the level is DEBUG.
(FINE JDK 记录FINE信息主要为开发使用。所有DEBUG级别的声明是防止的,所有只用级别为DEBUG才能执行。)
Setting the logging level to FINE should provide more information on the source of any problems. Many logging systems enable a logging level change to be made without restarting the application.
(设置日志级别为FINE应该提供任何问题的更多的源信息。许多日志系统可以在不重启应用程序修改日志级别。)
相关文章推荐
- Ehcache 1.5.0 User Guide - Introduction (介绍)(2)
- Ehcache 1.5.0 User Guide - Cache Configuration 缓存配置(2)
- Ehcache 1.5.0 User Guide - Code Samples 代码实例2
- Ehcache 1.5.0 User Guide - Getting Started(开始)
- Ehcache 1.5.0 User Guide - Dependencies(依赖)
- Ehcache 1.5.0 User Guide - Remote Network debugging and monitoring for Distributed Caches(远程调式和跟踪分布式缓存)(11)
- Ehcache 1.5.0 User Guide - Introduction (介绍)(1)
- Ehcache 1.5.0 User Guide - Cache Concepts (缓存概念)
- Ehcache 1.5.0 User Guide - Cache Eviction Algorithms (缓存移出算法)
- Ehcache 1.5.0 User Guide - Cache Configuration 缓存配置(3)
- Ehcache 1.5.0 User Guide - Code Samples 代码实例 3
- Ehcache 1.5.0 User Guide - Cache Configuration 缓存配置(1)
- Ehcache 1.5.0 User Guide - Code Samples 代码实例 (1)
- Ehcache 1.5.0 User Guide - Java Requirements and Dependencies JAVA要求和依赖
- Ehcache 1.5.0 User Guide - preface(序言)
- GradleUserGuide中文版 10)网页应用 11)Gradle命令行
- flume User Guide翻译-logging raw data / plugin
- 日志组件系列:(1)Top 10 Tips on Logging in Java
- GradleUserGuide中文版 16)Ant插件 17)Logging 18)Daemon 19)Plugins
- mybatis_user_guide(8) 日志