Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

[ASP.NET]Log4NetÈ«¹¥ÂÔ

 [ASP.NET]Log4NetÈ«¹¥ÂÔ
ת×Ô:http://blog.5d.cn/vip/icecream/200511/185284.html
ºÜ¶à¿ª·¢Õ߶¼ÏëÒªÒ»¸ö·Ç³£Ç¿´óµÄ³ÌÐòÈÕÖ¾¹ÜÀí¿â£¬Äܹ»Á˽âÓû§¶ÔÓ¦ÓóÌÐòµÄʹÓÃÇé¿ö¡£µ±³ÌÐò³öÏÖÎÊÌâʱ£¬¿ÉÒÔͨ¹ý·ÖÎöÈÕÖ¾À´Á˽âÎÊÌâÖ®ËùÔÚ¡£
¹ýÈ¥ÎÒÃÇ×ÜÊÇÓÃÒ»Öֺܼòµ¥µÄ·½Ê½À´´¦ÀíÈÕÖ¾£¬¼´£ºÊ¹ÓÃÒ»¸öÈÕÖ¾Îļþ£¬µ±³ÌÐòÓÐÎÊÌâʱ¾ÍÒªÇóÓû§ÌṩÕâ¸öÎļþ¡£µ«³£³£ÈÕÖ¾Îļþ²»ÊÇûÓУ¬¾ÍÊÇÒѾ­±»É¾³ý¡£
Log4net ÊÇÖøÃûµÄ log4j for Java ÏîÄ¿µÄÒ»²¿·Ö¡£ËüÊÇÓÉ
www.neoworks.com
µÄÒ»¸öÍŶӿª·¢³öÀ´£¬Ö§³Ö¶àÖÖ·½Ê½µÄÈÕÖ¾¡£Èç ADO (MS Sql Server µÈ),File (Îļþ), Console (¿ØÖÆ̨),EventLog (ϵͳÈÕÖ¾),SMTP(Óʼþ·½Ê½)...
¶øÇÒÖ§³ÖËùÓеÄ.Net ƽ̨£º
Microsoft .Net Framework 1.0 (1.0.3705)
Microsoft .Net Framework 1.1 (1.1.4322)
Microsoft .Net Compact Framework 1.0 (1.0.5000)
Mono 0.25 or higher (Linux 쵀)
Microsoft Shared Source CLI 1.0 (¾ÍÊÇMS ¿ª·¢Ô´´úÂëµÄ .Net ÔËÐпâ)
Èç¹ûÄãÒªÁ˽â¸üÏêϸµÄÐÅÏ¢:
log4net Site For Apache
(log4net µÄ¹Ù·½Õ¾µã)
Using log4Net
(һƪºÜרҵµÄʹÓÃÖ¸ÄÏ£¬ÏÂÃæÓз­Òë)
log4net.dll
(ÎÒÕÒµ½µÄ±àÒëºÃµÄ log4net.dll Îļþ£¬¿ÉÒÔÖ±½Ó¼ÓÈëÄãµÄ¹¤³Ì¡£)
Log4NetʹÓÃÖ¸ÄÏ
1 ¼ò½é
1.1 Log4netµÄÓŵ㣺
¼¸ºõËùÓеĴóÐÍÓ¦Óö¼»áÓÐ×Ô¼ºµÄÓÃÓÚ¸ú×Ùµ÷ÊÔµÄAPI¡£ÒòΪһµ©³ÌÐò±»²¿ÊðÒԺ󣬾Ͳ»Ì«¿ÉÄÜÔÙÀûÓÃרÃŵĵ÷ÊÔ¹¤¾ßÁË¡£È»¶øÒ»¸ö¹ÜÀíÔ±¿ÉÄÜÐèÒªÓÐÒ»Ì×Ç¿´óµÄÈÕ־ϵͳÀ´Õï¶ÏºÍÐÞ¸´ÅäÖÃÉϵÄÎÊÌâ¡£
¾­Ñé±íÃ÷£¬ÈÕÖ¾¼Ç¼ÍùÍùÊÇÈí¼þ¿ª·¢ÖÜÆÚÖеÄÖØÒª×é³É²¿·Ö¡£Ëü¾ßÓÐÒÔϼ¸¸öÓŵ㣺Ëü¿ÉÒÔÌṩӦÓóÌÐòÔËÐÐʱµÄ¾«È·»·¾³£¬¿É¹©¿ª·¢ÈËÔ±¾¡¿ìÕÒµ½Ó¦ÓóÌÐòÖеÄBug£»Ò»µ©ÔÚ³ÌÐòÖмÓÈëÁËLog Êä³ö´úÂ룬³ÌÐòÔËÐйý³ÌÖоÍÄÜÉú³É²¢Êä³öÈÕÖ¾ÐÅÏ¢¶øÎÞÐèÈ˹¤¸ÉÔ¤¡£ÁíÍ⣬ÈÕÖ¾ÐÅÏ¢¿ÉÒÔÊä³öµ½²»Í¬µÄµØ·½£¨¿ØÖÆ̨£¬ÎļþµÈ£©ÒÔ±¸ÒÔºóÑо¿Ö®Óá£
Log4net¾ÍÊÇΪÕâÑùÒ»¸öÄ¿µÄÉè¼ÆµÄ£¬ÓÃÓÚ.NET¿ª·¢»·¾³µÄÈÕÖ¾¼Ç¼°ü¡£
1.2 Log4netµÄ°²×°£º
Óû§¿ÉÒÔ´Óhttp://logging.apache.org/log4net/ÏÂÔØlog4netµÄÔ´´úÂë¡£½âѹÈí¼þ°üºó£¬ÔÚ½âѹµÄsrcĿ¼Ï½«log4net.slnÔØÈëVisual Studio .NET£¬±àÒëºó¿ÉÒԵõ½log4net.dll¡£Óû§ÒªÔÚ×Ô¼ºµÄ³ÌÐòÀï¼ÓÈëÈÕÖ¾¹¦ÄÜ£¬Ö»Ð轫log4net.dllÒýÈ빤³Ì¼´¿É¡£
2 Log4netµÄ½á¹¹
log4net ÓÐËÄÖÖÖ÷ÒªµÄ×é¼þ£¬·Ö±ðÊÇLogger£¨¼Ç¼Æ÷£©, Repository£¨¿â£©, Appender£¨¸½×ÅÆ÷£©ÒÔ¼° Layout£


Ïà¹ØÎĵµ£º

ASP.NETÉú³ÉËæ»úÃÜÂë

 ÔÚ¿ª·¢ÐèÒªÓû§×¢²áºó²ÅÄÜʹÓÃÌṩµÄ¸÷ÏÄܵÄÓ¦ÓóÌÐòʱ£¬ÔÚÐÂÓû§Ìá½»×¢²áÐÅÏ¢ºó£¬½Ï³£¼ûµÄ×ö·¨ÊÇÓɳÌÐòÉú³ÉËæ»úÃÜÂ룬Ȼºó·¢ËÍÃÜÂëµ½Óû§×¢²áʱÌîдµÄµç×ÓÐÅÏ䣬Óû§ÔÙÓÃÊÕµ½µÄÃÜÂëÀ´¼¤»îÆäÕÊ»§¡£
ʵÏÖASP.NETÉú³ÉËæ»úÃÜÂ빦ÄÜÊǺÜÈÝÒ׵ģ¬ÏÂÃæµÄ´úÂë¸ø³öÁËÍêÕûµÄʵÏÖ·½·¨£º
publicstaticstringMakePassword(st ......

³¤ÄÚÈÝ×Ô¶¯·ÖÒ³µÄʵÏÖ (asp.net C#)

 
public class t3 : System.Web.UI.Page
        {  
                private string str;//×Ö·û
            &n ......

ASP.NET

 ASP.NETÖÐÌṩÁËÁ½ÖÖ»º´æ¸üвßÂÔ£º
   1.±»¶¯¸üС£»º´æ¹ýÆÚÒÔºóÊÖ¶¯½øÐиüÐÂ
   2.Ö÷¶¯¸üС£»º´æ¹ýÆÚÒÔºóÔڻص÷·½·¨ÖиüÐÂ
Èç¹ûÎÒÃÇÏÖÔÚÒª»º´æÒ»¸öÊý¾Ý¼¯£ºDataSet ds=getData();//getdata()ÊÇÒ»¸ö×Ô¶¨Òå·½·¨£¬´ÓÊý¾Ý¿â»ñÈ¡Êý¾Ý
   A.²åÈëÓÀ²»¹ýÆڵĻº´æ£ºCache.Insert("d ......

ASP.NETÉú³ÉËæ»úÃÜÂë

ASP.NETÉú³ÉËæ»úÃÜÂë
ÔÚ¿ª·¢ÐèÒªÓû§×¢²áºó²ÅÄÜʹÓÃÌṩµÄ¸÷ÏÄܵÄÓ¦ÓóÌÐòʱ£¬ÔÚÐÂÓû§Ìá½»×¢²áÐÅÏ¢ºó£¬½Ï³£¼ûµÄ×ö·¨ÊÇÓɳÌÐòÉú³ÉËæ»úÃÜÂ룬Ȼºó·¢ËÍÃÜÂëµ½Óû§×¢²áʱÌîдµÄµç×ÓÐÅÏ䣬Óû§ÔÙÓÃÊÕµ½µÄÃÜÂëÀ´¼¤»îÆäÕÊ»§¡£
ʵÏÖASP.NETÉú³ÉËæ»úÃÜÂ빦ÄÜÊǺÜÈÝÒ׵ģ¬ÏÂÃæµÄ´úÂë¸ø³öÁËÍêÕûµÄʵÏÖ·½·¨£º
public static stri ......

Asp.netÖзÀÖ¹Óû§¶à´ÎµÇ¼µÄ·½·¨

 ÔÚweb¿ª·¢Ê±£¬ÓеÄϵͳҪÇóͬһ¸öÓû§ÔÚͬһʱ¼äÖ»ÄܵǼһ´Î£¬Ò²¾ÍÊÇÈç¹ûÒ»¸öÓû§ÒѾ­µÇ¼ÁË£¬ÔÚÍ˳ö֮ǰÈç¹ûÔٴεǼµÄ»°ÐèÒª±¨´í¡£
¡¡¡¡³£¼ûµÄ´¦Àí·½·¨ÊÇ£¬ÔÚÓû§µÇ¼ʱ£¬ÅжϴËÓû§ÊÇ·ñÒѾ­ÔÚApplicationÖдæÔÚ£¬Èç¹û´æÔھͱ¨´í£¬²»´æÔڵĻ°¾Í¼Óµ½ApplicationÖÐ(ApplicationÊÇËùÓÐSession¹²Óеģ¬Õû¸öwebÓ¦ÓÃ³Ì ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ