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
Ïà¹ØÎĵµ£º
ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖƵÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬ ......
ÔÚÀàÖж¨ÒåµÄ·½·¨ÔÚ·µ»Øֵǰ¼ÓÉÏstaticÐÞÊηû¾Í¿ÉÒÔÔÚmain·½·¨Öе÷ÓÃÁË¡£Èç¹û²»ÓÃstaticÄǾÍÐèÒªÔÚmain·½·¨Öд´½¨¶ÔÏó£¬Ê¹ÓöÔÏóÀ´µ÷ÓöÔÏóµÄ·½·¨¡£
public class Test{
public static void main(String[] args){
Test t=new Test();
int b=1;
int c=2;
int[] ......
Ò»¡¢±à¼JavaÔ´Îļþ
=============================================
Hello.java
=============================================
package test;
public class Hello
{
static
{
try
{
//´Ë´¦¼´Îª±¾µØ·½·¨ËùÔÚÁ´½Ó¿âÃû
&n ......
Êý¾Ý¿â²Ù×÷ÏÖÔÚÊÇÏîÄ¿¿ª·¢µÄ¸ù±¾£¬Ñ§Ï°JavaÊ×ÏÈÓ¦¸Ãѧ»áÔõôÑùÁ¬½ÓÊý¾Ý¿â£¬ÓÃJavaÁ¬½ÓÊý¾Ý¿â¿É²»ÏñÓÃDelphiÕâÀ๤¾ßÄÇÑùÉ輸¸öÊôÐÔ¾ÍOK£¬Ëµ¼òµ¥Ò²¼òµ¥£¬Ëµ¸´ÔÓ£¬ÆäʵҲͦ¸´Ôӵģ¬¶øÇÒºÜÂé·³£¬Èç¹ûÊdzõѧ£¬¸ù±¾²»Äܱ£Ö¤µÚÒ»´Î¾ÍÁ¬½Ó³É¹¦£¬ÏÂÃæÒÔSQL Server 2000ΪÀý£¬ËµËµJavaÁ¬½ÓÊý¾Ý¿âµÄ»ù±¾·½·¨£¬Ò²¼Ç¼һÏÂÐĵá£
1¡¢Ï ......
±¾ÎÄת×Ôhttp://kingsui.javaeye.com/blog/154712
javaµ¼Èëµ¼³öexcel²Ù×÷(jxl)
Java½âÊÍExcelÊý¾Ý£¨jxl.jar°üµÄʹÓã©
¹Ø¼ü×Ö: java excel jxl.jar
jxl.jar °ü
ÏÂÔصØÖ·:
http://www.andykhan.com/jexcelapi/
ÕæʵÏÂÔصØÖ·:
http://www.andykhan.com/jexcelapi/download.html
ÍøÕ¾É϶ÔËüµÄÌØÕ÷ÓÐÈçÏÂÃèÊö£ ......