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学习从入门到精通
一、 JDK (Java Development Kit)
JDK是整个Java的核心,包括了Java运行环境(Java Runtime Envirnment),一堆Java工具和Java基础的类库(rt.jar)。不论什么Java应用服务器实质都是内置了某个版本的JDK。因此掌握JDK是学好Java的第一步。最主流的J ......
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
这是JAVA中的一个作业,
效果图:
画框中共有六个球,它们碰到墙之后能够反弹,而且相互碰撞之后能相互碰撞。
要用到的知识: ......
面向对象的三大特征:封装、继承、多态。
java中的封装
封装,一个对象和外界的联系应当通过一个统一的接口,应当公开的公开,应当隐藏的隐藏。(对象的属性应当隐藏),一个对象的内部是透明的,就是把对象内部的可透明性和隐藏的特性区分开,该透明的透明,该隐藏的隐藏。
(封装的属性)java中类的属性的访问权限的默 ......