log4e插件的安装和配置
《log4e插件的安装和配置》由会员分享,可在线阅读,更多相关《log4e插件的安装和配置(9页珍藏版)》请在装配图网上搜索。
1、单击 window -GeneralAmafieu 3-5TomcatHelp Q ”申0 -:&.军*齐w妒Q Prerersnces琵 OutfikB ; 帥 outline- isLog4j Deibug/JDKIJ ConfigLogger Message-startI Slop losing for this. 口口胡on?l 5kllP CDnytruciorQlUe posrticHi log slalemeiitt nstead of levelChoose I她I习nwrt 诂Fo mbwt cu盯的t method71 Log twithtvpfl-; 口F Lag wit
2、h parameter valu af methodtJ IInsertRrevipi,*- Fe-ippiy3review SubttjlulirjnRwlcwe DefauHsLog4e 自动生成日志使用方法1.1 拷贝压缩包1. Log4e是一个免费的Eclipse Plugin,它可帮助你在你的Java工程中快速加入Log;我们可以 在 http:/log4e.jayefem.de/index.php/Download 网站上下载 Log4e 最新版本。我用的 og4e 的 版本是:de.jayefem.log4e_free_133.zip2. 在eclipse的安装目录下,找到相应的
3、plugins和features文件夹,将解压后得到的两个文 件夹plugins和features下对应的文件拷贝到相应的目录下。如:我的Eclipse放在D盘的D:Program Files目录下。(以下都以此目录为例)3. 重启Eclipse,就可以使用log4e插件了。如果安装后看不到插件,把eclipse安装目录下的 configuration/org.eclipse.update/目录整个删除,重启 eclipse。1.2 在 Eclipse 配置 log4epreferences -在弹出的对话框左边树状结构中找到log4e (单击)Mtlhod feart M1hod Exit
4、Catch Block Other (For U口!g thic 甘pf&blfi!Hibernate Install/Updfil?FormatImports and DrclrrlSubstilutiGnTotringBuilder U&er nttract!on Plug-in Development RunjTZtlbug TeamTcmcat单击Position选项- 在右边的Choose Level的下拉列表中选择日志器的种类,这里选择 Log4j,然后单击“确定”即可。1.3 在 Eclipse 中使用 log4e1.选中要添加日志类 单击鼠标右键一 Iog4e -log thi
5、s class给类添加日志然后会看到 preview 画面确定后结果如下:注意,为该类中的每个method都生成了 log语句2.选中要添加日志类单击鼠标右键一 log4e -log at method给某个方法添加日志3.选中要添加日志类单击鼠标右键一 log4e - log at this position在指定位置添加日志国pieFile EditLog4Efem/log-le/ex am pls/LogDedare loggerReapply in this methodReapply in this dassRemove logger in this metfiodRemove lo
6、gger of this dassExange logging frann 亡 work, af this dassSubstitute SystErm.outs in this methodSubstitutE SystEm.oLifs in this dassGreats ToStringStyle dass. pen Interface pen Irple mentationOpen DeclarationOpen Type Hierarchy pen Call Hierarchy Quick Outline QuickType HierarchyShaw In錮 Add to Snip
7、pets.lu 凫ai*uar*h 厂 qgAlt-bShift+S十ShiftsPasteSour匚已RefactDrLocal HistoryReferencesDedaratiQnsComnnansE LangConvert_J Easy Explore.Run rtsDebug AsProfile AsConvert t曰bs spaceslearnCompare WithReplace WithCtrl+Alt+iCtrl 40Ctrl-FTAlt十Shift十讪Ctrl+KCtrl-H:Ctrl+VRun Window Helpplea;Hl;Log this variableLo
8、g at this position.Log this methodLog this dass曰脸观旦显示所有变量和值回冈Specifiy the variables that shouki be loggedLogger message my messageGlobal variablesMetinod paramet&rstypenameStringaGlobalVarAvailable local variabl亡Available exceptionstypenarn 亡J Include type infoLevelLcg4j Infb/JDK14 Info*2| Use Jakar
9、ta ToStringGeneratcir M Surround witii isLevelEnabledQEini 曲匚 ancel皿4nPreviewModified Source/arLd.Le3:xc.er:tTLVDrr rr ;e= void二 an.d.1 e;& vo-i d.do Soititvoi-d sandLeZxception (i lit 二)doSoiuething ();tci ( Zxcep匸iciii myExcep匸iciii) iart 己二口匚己二= 0;(Logger . slnfcHInahled ()-Logger . nf ( ri trieM
10、e tried ( 3 trine f i Et- aG_aLalVar - n r rg2 = n -己- I n f alccaLVar =n - alccaLVar - Z/HC f ir.y:x匚亡匚t二口匸=-nyExc-eption.) ;/Original Sourcei St二二ng theMe T :iQSQimetlLinc catch (Zxc.亡 pt iat alcicaL7.jiandleZxcept iciii alocaLVar1.4 改日志的级别在 Log4e 的子菜单 Positions 中,如 下图所示,在右边的下拉菜单中可以改输出日志的级 别,默认为debug。在红色长方体内的选项是添加日志的地方。可根据具体需求自己设定。
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。