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
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
ÔÚÎÒÃÇÆ½Ê±Ð´³ÌÐòµÄʱºò£¬ÓÐЩ²ÎÊýÊǾ³£¸Ä±äµÄ£¬¶øÕâÖָı䲻ÊÇÎÒÃÇÔ¤ÖªµÄ¡£±ÈÈç˵ÎÒÃÇ¿ª·¢ÁËÒ»¸ö²Ù×÷Êý¾Ý¿âµÄÄ£¿é£¬ÔÚ¿ª·¢µÄʱºòÎÒÃÇÁ¬½Ó±¾µØµÄÊý¾Ý¿âÄÇô IP £¬Êý¾Ý¿âÃû³Æ£¬±íÃû³Æ£¬Êý¾Ý¿âÖ÷»úµÈÐÅÏ¢ÊÇÎÒÃDZ¾µØµÄ£¬ÒªÊ¹µÃÕâ¸ö²Ù×÷Êý¾ÝµÄÄ£¿é¾ßÓÐͨÓÃÐÔ£¬ÄÇôÒÔÉÏÐÅÏ¢¾Í²»ÄÜдËÀÔÚ³ÌÐòÀͨ³£ÎÒÃǵÄ×ö·¨ÊÇÓÃÅäÖÃÎļþÀ´½â ......
SunÔÚJava5ÖУ¬¶ÔJavaÏ̵߳ÄÀà¿â×öÁË´óÁ¿µÄÀ©Õ¹£¬ÆäÖÐÏ̳߳ؾÍÊÇJava5µÄÐÂÌØÕ÷Ö®Ò»£¬³ýÁËÏ̳߳ØÖ®Í⣬»¹Óкܶà¶àÏß³ÌÏà¹ØµÄÄÚÈÝ£¬Îª¶àÏ̵߳ıà³Ì´øÀ´Á˼«´ó±ãÀû¡£ÎªÁ˱àд¸ßЧÎȶ¨¿É¿¿µÄ¶àÏ̳߳ÌÐò£¬Ï̲߳¿·ÖµÄÐÂÔöÄÚÈÝÏÔµÃÓÈÎªÖØÒª¡£
ÓйØJava5Ïß³ÌÐÂÌØÕ÷µÄÄÚÈÝÈ«²¿ÔÚjava.util.concurrentÏÂÃæ£¬ÀïÃæ°üº¬ÊýÄ¿ÖÚ¶à ......
javaÓïÑÔÊǽâÊÍÖ´ÐУ¬javaÔ´ÂëÊÇͨ¹ý±àÒëÉú³ÉÒ»ÖÖÌØÊâµÄ.classµÄÖмä×Ö½âÂëÎļþ£¬È»ºóÔÙÓÐJVM½øÐнâÊÍÖ´ÐС£
javaÓïÑÔ¶ÔÖ¸Õë½øÐÐÁËÉϲãµÄ·â×°£¬Ëü±£Ö¤Äܹ»Í¨¹ýÕâ¸öÖ¸Õ루ÒýÓã©£¬À´·ÃÎÊÓÐЧµÄÄÚ´æµ¥Ôª¡£
javaÓïÑÔ²»ÔÊÐí¶à¼Ì³Ð£¬Ê¹¼Ì³Ð¹ØÏµ³ÉÊ÷װͼ£¬Ã¿¸öÀà¶¼Ö»ÄÜÓÉÒ»¸ö¸¸Àà¡£
javaÓïÑԵĿª·¢Ð§Âʸߣ¬µ«Ö´ÐÐЧÂʵ͡££¨Ïൠ......
ÃæÏò¶ÔÏóµÄÈý´óÌØÕ÷£º·â×°¡¢¼Ì³Ð¡¢¶à̬¡£
javaÖеķâ×°
·â×°£¬Ò»¸ö¶ÔÏóºÍÍâ½çµÄÁªÏµÓ¦µ±Í¨¹ýÒ»¸öͳһµÄ½Ó¿Ú£¬Ó¦µ±¹«¿ªµÄ¹«¿ª£¬Ó¦µ±Òþ²ØµÄÒþ²Ø¡££¨¶ÔÏóµÄÊôÐÔÓ¦µ±Òþ²Ø£©£¬Ò»¸ö¶ÔÏóµÄÄÚ²¿ÊÇ͸Ã÷µÄ£¬¾ÍÊǰѶÔÏóÄÚ²¿µÄ¿É͸Ã÷ÐÔºÍÒþ²ØµÄÌØÐÔÇø·Ö¿ª£¬¸Ã͸Ã÷µÄ͸Ã÷£¬¸ÃÒþ²ØµÄÒþ²Ø¡£
£¨·â×°µÄÊôÐÔ£©javaÖÐÀàµÄÊôÐԵķÃÎÊȨÏÞµÄĬ ......