Changes between Version 20 and Version 21 of LogViewerPlugin
- Timestamp:
- Aug 20, 2015, 9:08:28 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LogViewerPlugin
v20 v21 7 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. 8 8 9 Be careful with large log files: use the tail-function to limit the output , whichwould otherwise take a very long time to display.9 Be careful with large log files: use the tail-function to limit the output to the last few lines, because it would otherwise take a very long time to display. 10 10 11 11 == Bugs/Feature Requests … … 15 15 16 16 If you have any issues, create a 17 [ http://trac-hacks.org/newticket?component=LogViewerPlugin&owner=izzynew ticket].17 [/newticket?component=LogViewerPlugin new ticket]. 18 18 19 19 [[TicketQuery(component=LogViewerPlugin,group=type,format=progress)]] … … 30 30 31 31 The easiest way to install this plugin is: 32 {{{ 33 #!bash 32 {{{#!sh 34 33 # Trac before "localization" started somewhere in 0.11: 35 34 easy_install http://trac-hacks.org/svn/logviewerplugin/branches/0.11 … … 38 37 }}} 39 38 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.39 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. 41 40 42 Moreover, you will need to enable the plugin for your Trac environment(s): 43 {{{ 44 #!ini 41 Moreover, you will need to enable the plugin for your Trac environment(s) in your `trac.ini` file: 42 {{{#!ini 45 43 [components] 46 44 logviewer.* = enabled … … 49 47 == Configuration 50 48 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 youthe details. For everybody else, the details are here:49 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 the details. For everybody else, the details are here: 52 50 53 51 You need to introduce a new section to your `trac.ini` file. Using the default settings, it would look like this: 54 {{{ 55 #!ini 52 {{{#!ini 56 53 [logviewer] 57 54 autoload = false … … 63 60 `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`. 64 61 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.62 `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. 66 63 67 64 `autolevel`:: Specifies the log level to display, and `autoup` decides whether higher priority levels, ie those with lower numbers, shall be included: … … 74 71 If you are not happy with the default presets of the form fields, you can change them for some of the fields: 75 72 76 {{{ 77 #!ini 73 {{{#!ini 78 74 [logviewer] 79 75 defaultlevel = 3 … … 82 78 }}} 83 79 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.80 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. 85 81 86 82 == Usage 87 83 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).84 You find the ''Log Viewer'' on the ''Admin'' page in the ''General'' section (see [#Example below]). Having this page called, 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. 89 85 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.86 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, ie only lines ''not'' containing/matching your search term will be shown. 91 87 92 88 Hovering your mouse over the input areas will give you a short tooltip with the meanings. 93 89 94 Once you made your selections, push the button -and the matching lines from the `trac.log` will be displayed.90 Once you made your selections, push the button and the matching lines from the `trac.log` will be displayed. 95 91 96 92 == Example … … 100 96 [[Image(logviewer.jpg)]] 101 97 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.98 As you can see, the log lines are quite colorful: each log level has its distinct color assigned. If you like to change the 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. 103 99 104 100 == User Comments 105 101 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):102 * Your feedback here, please. Or if you don't want to write something, use the poll below (you must be logged in to vote): 107 103 * olemis: This plugin is cool and very useful (especially to manage remote Trac instances ''';o)'''. 108 104 Nonetheless, if you are debugging then you might like to try TracDeveloperPlugin too.