Changes between Version 19 and Version 20 of LogViewerPlugin
- Timestamp:
- Mar 7, 2015, 12:10:40 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LogViewerPlugin
v19 v20 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 = View the trac.log file via the web frontend =3 2 4 == Description == 3 = View the trac.log file via the web frontend 4 5 == Description 5 6 6 7 This plugin allows you to view your `trac.log` logfile without shell access to the server, just via the Web-UI Admin interface. You can select to only display messages from a specified log level (e.g. only warnings), optionally including higher levels. So if you select "Debug" and all higher levels, this means to display the entire log. Moreover, you may restrict the output to the latest N lines, and even filter for lines containing a specified string or even matching a regular expression. 7 8 8 Be careful with large log files ;)9 Be careful with large log files: use the tail-function to limit the output, which would otherwise take a very long time to display. 9 10 10 == Bugs/Feature Requests ==11 == Bugs/Feature Requests 11 12 12 13 Existing bugs and feature requests for LogViewerPlugin are … … 16 17 [http://trac-hacks.org/newticket?component=LogViewerPlugin&owner=izzy new ticket]. 17 18 18 == Download == 19 [[TicketQuery(component=LogViewerPlugin,group=type,format=progress)]] 20 21 == Download 19 22 20 23 Download the zipped source from [download:logviewerplugin here] (development version). You can also download the [attachment:LogViewerPlugin-0.2-py2.5.egg Python Egg] of the latest release from this page. 21 24 22 == Source ==25 == Source 23 26 24 27 You can check out LogViewerPlugin from [http://trac-hacks.org/svn/logviewerplugin here] using Subversion, or [source:logviewerplugin browse the source] with Trac. 25 28 26 == Installation == 29 == Installation 30 27 31 The easiest way to install this plugin is: 28 32 {{{ … … 34 38 }}} 35 39 36 If you want to be verysure to get stable code, you can alternatively use the latest tag, replacing `/trunk` by e.g. `/tags/0.2` (for v0.2). You can also checkout the code from the repository, or download and unpack the zipped source (see above) - and then run either `easy_install` or `python setup.py` from where the `setup.py` file resides.40 If you want to be sure to get stable code, you can alternatively use the latest tag, replacing `/trunk` by e.g. `/tags/0.2` (for v0.2). You can also checkout the code from the repository, or download and unpack the zipped source (see above) - and then run either `easy_install` or `python setup.py` from where the `setup.py` file resides. 37 41 38 Moreover, you will need to enable the plugin for your trac environment(s):42 Moreover, you will need to enable the plugin for your Trac environment(s): 39 43 {{{ 44 #!ini 40 45 [components] 41 46 logviewer.* = enabled 42 47 }}} 43 48 44 There's no more configuration required. 49 == Configuration 45 50 46 == Configuration == 47 No - no kidding. I said there's no more configuration ''required'' - however, it is ''possible''. If you want the LogViewerPlugin to immediately load and show content from your log file without the need to first (fill some form and) push the button, you can do so. With the IniAdminPlugin installed, just call up the ''logviewer'' section, and it will explain you the details. For everybody else, the details are here: 51 If you want the LogViewerPlugin to immediately load and show content from your log file without the need to first (fill some form and) push the button, you can do so. With the IniAdminPlugin installed, just call up the ''logviewer'' section, and it will explain you the details. For everybody else, the details are here: 48 52 49 53 You need to introduce a new section to your `trac.ini` file. Using the default settings, it would look like this: 50 54 {{{ 55 #!ini 51 56 [logviewer] 52 57 autoload = false … … 56 61 }}} 57 62 58 So what do those settings mean? Quite clear: `autoload` decides whether you want to turn this feature on (`true`) or not. By default, it is turned off. All the other `auto*` settings only apply if you set `autoload = true`.63 `autoload`:: Decides whether you want to turn this feature on (`true`) or not. By default, it is turned off. All the other `auto*` settings only apply if you set `autoload = true`. 59 64 60 With the `autotail` setting you limit LogViewerPlugin to those many lines from the end of the file. Normally, 1000 lines will be enough - but if you want to show everything, simply set it to an empty value (as shown below for `defaulttail`). Keep in mind that with a huge log file, the page will take some time to load - every time you call up LogViewerPlugin. So betterkeep this value to something reasonable, and do the unusual full display on demand only.65 `autotail`:: Limit LogViewerPlugin to those many lines from the end of the file. Normally, 1000 lines will be enough - but if you want to show everything, simply set it to an empty value (as shown below for `defaulttail`). Keep in mind that a large log file will take some time to display. So keep this value to something reasonable, and do the unusual full display on demand only. 61 66 62 `autolevel` specifies the log level to display, and `autoup` decides whether higher priority levels (i.e. those with lower numbers) shall be included. Note that this is a numeric value (integer, to be more precise) - and reaches from 1=critical to 5=debug (including 2=error, and 4=info), with a default of 3=warning. 67 `autolevel`:: Specifies the log level to display, and `autoup` decides whether higher priority levels, ie those with lower numbers, shall be included: 68 * 1 = critical 69 * 2 = error 70 * 3 = warning (default) 71 * 4 = info 72 * 5 = debug 63 73 64 If you are not happy with the default presets of the form fields - you can change them for some of the fields: 74 If you are not happy with the default presets of the form fields, you can change them for some of the fields: 75 65 76 {{{ 77 #!ini 66 78 [logviewer] 67 79 defaultlevel = 3 … … 69 81 defaulttail = 70 82 }}} 83 71 84 The meaning of those three settings corresponds to the similarly named items from the autoload - with the difference that the values here only apply when autoload is disabled. 72 85 73 == Usage == 86 == Usage 87 74 88 You find the ''Log Viewer'' on the ''Admin'' page in the ''General'' section (see [#Example below]). Having this page called, you select the log level you wish to see the entries for, using the drop-down. Optionally, you may chose to display all "higher priority" as well (where "higher" means the entries on top of the one you selected). 75 89 76 90 Optionally, you now can further restrict the amount of lines displayed: The ''Tail'' input works similar to the `tail -f` command, only showing the last N lines. If you input nothing here, this restriction is skipped - but if you do, the following search will be limited to these lines. In the ''Search'' input box you can enter a term which must be found in a line to be displayed. You can also use regular expressions here, in which case you must check the corresponding button. If you additionally check the "not" button, that search will be inverted - i.e. only lines ''not'' containing/matching your search term will be shown. 77 91 78 Oh, btw: hovering your mouse over the input areas will give you a short tooltip, in case you forgot these meanings ;) 92 Hovering your mouse over the input areas will give you a short tooltip with the meanings. 79 93 80 94 Once you made your selections, push the button - and the matching lines from the `trac.log` will be displayed. 81 95 82 == Example ==96 == Example 83 97 84 He ll, what example? OK: Here is what it may look like, having selected "Info and above":98 Here is what it may look like, having selected "Info and above": 85 99 86 100 [[Image(logviewer.jpg)]] … … 88 102 As you can see, the log lines are quite colorful: each log level has its distinct color assigned. If you don't like my choice of colors here, you can easily apply your own style sheets. All elements can be identified without problems: the different log levels use classes, and even the other elements of the GUI use classes and ids. Furthermore, in this example you might note that obviously nothing was logged at "Info" level - nevermind, it works. 89 103 90 == User Comments == 104 == User Comments 105 91 106 * Your feedback here, please :-) Or if you don't want to write something yourself, use the poll below (you must be logged in to vote): 92 107 * olemis: This plugin is cool and very useful (especially to manage remote Trac instances ''';o)'''. … … 95 110 [[Poll(Let others know what you think about the LogViewerPlugin:;I use it and I like it!;I use it and find it acceptable.;I tried it and didn't like it;I think it's great stuff and will give it a try!;I don't know what to think about it.)]] 96 111 97 == Recent Changes ==112 == Recent Changes 98 113 99 114 [[ChangeLog(logviewerplugin, 3)]] 100 115 101 == Author/Contributors ==116 == Author/Contributors 102 117 103 118 '''Author:''' [wiki:izzy] [[BR]] 104 '''Maintainer:''' [ wiki:izzy] [[BR]]119 '''Maintainer:''' [[Maintainer]] [[BR]] 105 120 '''Contributors:'''