易截截图软件、单文件、免安装、纯绿色、仅160KB

the org.apache.log4j.PatternLayout java doc


A flexible layout configurable with pattern string.
The goal of this class is to format

a LoggingEvent

and return the results as a String. The results depend on the conversion
pattern
.
The conversion pattern is closely related to the conversion pattern of the
printf function in C. A conversion pattern is composed of literal text and
format control expressions called conversion specifiers
.
You are free to insert any literal text within the conversion pattern.

Each conversion specifier starts with a percent sign (%) and is followed by
optional format modifiers
and a conversion character
. The
conversion character specifies the type of data, e.g. category, priority, date,
thread name. The format modifiers control such things as field width, padding,
left and right justification. The following is a simple example.
Let the conversion pattern be "%-5p [%t]: %m%n"
and assume that the
log4j environment was set to use a PatternLayout. Then the statements
Category root = Category.getRoot();
root.debug("Message 1");
root.warn("Message 2");

would yield the output
DEBUG [main]: Message 1
WARN [main]: Message 2

Note that there is no explicit separator between text and conversion
specifiers. The pattern parser knows when it has reached the end of a conversion
specifier when it reads a conversion character. In the example above the
conversion specifier %-5p
means the priority of the logging event should
be left justified to a width of five characters. The recognized conversion
characters are
Conversion Character
Effect
c
Used to output the category of the logging event. The category conversion
specifier can be optionally followed by precision specifier
, that is a
decimal constant in brackets.
If a precision specifier is given, then only the corresponding number of
right most components of the category name will be printed. By default the
catego


相关文档:

Java NIO API详解

 
Java NIO API详解
在JDK
1.4以前,Java的IO操作集中在java.io这个包中,是基于流的阻塞(blocking)API。对于大多数应用来说,这样的API使用很方
便,然而,一些对性能要求较高的应用,尤其是服务端应用,往往需要一个更为有效的方式来处理IO。从JDK 1.4起,NIO
API作为一个基于缓冲区,并能提供非阻塞(non-blo ......

java集合小结

在使用Java的时候,我们都会遇到使用集合(Collection)的时候,但是Java API提供了多种集合的实现,我在使用和面试的时候频
频遇到这样的“抉择” 。 :)(主要还是面试的时候)
久而久之,也就有了一点点的心得体会,写出来以供大家讨论 。
总的说来,Java API中所用的集合类,都是实现了Collection接口,他 ......

java多线程例子

里我们做一个完整的例子来说明线程产生的方式不同而生成的线程的区别:
package debug;import java.io.*;import java.lang.Thread;class MyThread extends Thread{  public int x = 0;  public void run(){    System.out.println(++x);  }}class R implements Runnable{  private in ......

JAVA笔记(三)

面向对象的思想
anything is Object(万物皆对象)
抽象,从对具体的对象中抽取有用信息。
对象有其固有属性,对象的方法,即对象的行为(对象能做什么)
对象本身是简单的(功能简单),多个对象可以组成复杂的系统(对象之间彼此调用对方的方法)
对象应当是各司其职(功能简单),各尽所能(把自己的功能作到最好) ......

JAVA笔记(四)

面向对象的三大特征:封装、继承、多态。
java中的封装
封装,一个对象和外界的联系应当通过一个统一的接口,应当公开的公开,应当隐藏的隐藏。(对象的属性应当隐藏),一个对象的内部是透明的,就是把对象内部的可透明性和隐藏的特性区分开,该透明的透明,该隐藏的隐藏。
(封装的属性)java中类的属性的访问权限的默 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号