1458a6a73SNicolas Bonnefon 2458a6a73SNicolas Bonnefon## Getting started 3458a6a73SNicolas Bonnefon 4458a6a73SNicolas Bonnefon_glogg_ can be started from the command line, optionally passing the file to 5458a6a73SNicolas Bonnefonopen as an argument, or via the desktop environment's menu or file 6458a6a73SNicolas Bonnefonassociation. 7458a6a73SNicolas BonnefonIf no file name is passed, _glogg_ will initially open the last used file. 8458a6a73SNicolas Bonnefon 9458a6a73SNicolas BonnefonThe main window is divided in three parts : the top displays the log file. The 10458a6a73SNicolas Bonnefonbottom part, called the "filtered view", shows the results of the search. The 11458a6a73SNicolas Bonnefonline separating the two contains the regular expression used as a filter. 12458a6a73SNicolas Bonnefon 13458a6a73SNicolas BonnefonEntering a new regular expression, or a simple search term, will update the 14458a6a73SNicolas Bonnefonbottom view, displaying the results of the search. The lines matching the 15458a6a73SNicolas Bonnefonsearch criteria are listed in order in the results, and are marked with a red 16458a6a73SNicolas Bonnefoncircle in both windows. 17458a6a73SNicolas Bonnefon 18458a6a73SNicolas Bonnefon## Exploring log files 19458a6a73SNicolas Bonnefon 20458a6a73SNicolas BonnefonRegular expressions are a powerful way to extract the information you are 21458a6a73SNicolas Bonnefoninterested in from the log file. _glogg_ uses _extended regular expressions_. 22458a6a73SNicolas Bonnefon 23458a6a73SNicolas BonnefonOne of the most useful regexp feature when exploring logs is the 24458a6a73SNicolas Bonnefon_alternation_, using parentheses and the | operator. It searches for several 25458a6a73SNicolas Bonnefonalternatives, permitting to display several line types in the filtered window, 26458a6a73SNicolas Bonnefonin the same order they appear in the log file. 27458a6a73SNicolas Bonnefon 28458a6a73SNicolas BonnefonFor example, to check that every connection opened is also closed, one can use 29458a6a73SNicolas Bonnefonan expression similar to: 30458a6a73SNicolas Bonnefon 31458a6a73SNicolas Bonnefon`Entering (Open|Close)Connection` 32458a6a73SNicolas Bonnefon 33458a6a73SNicolas BonnefonAny 'open' call without a matching 'close' will immediately be obvious in the 34458a6a73SNicolas Bonnefonfiltered window. 35458a6a73SNicolas BonnefonThe alternation also works with the whole search line. For example if you also 36458a6a73SNicolas Bonnefonwant to know what kind of connection has been opened: 37458a6a73SNicolas Bonnefon 38458a6a73SNicolas Bonnefon`Entering (Open|Close)Connection|Created a .* connection` 39458a6a73SNicolas Bonnefon 40458a6a73SNicolas Bonnefon`.*` will match any sequence of character on a single line, but _glogg_ will only 41458a6a73SNicolas Bonnefondisplay lines with a space and the word `connection` somewhere after `Created a` 42458a6a73SNicolas Bonnefon 43458a6a73SNicolas Bonnefon## Using filters 44458a6a73SNicolas Bonnefon 45458a6a73SNicolas Bonnefon_Filters_ can colorize some lines of the log being displayed, for example to 46458a6a73SNicolas Bonnefondraw attention to lines indicating an error, or to associate a color with each 47458a6a73SNicolas Bonnefonsort of event. Any number of filter can be defined in the 'Filters' 48458a6a73SNicolas Bonnefonconfiguration dialog, each using a regexp against which lines will be matched. 49458a6a73SNicolas BonnefonFor each line, all filters are tried in order and the fore and back colors of 50458a6a73SNicolas Bonnefonthe first successful filter are applied. 51458a6a73SNicolas Bonnefon 52458a6a73SNicolas Bonnefon## Browsing changing log files 53458a6a73SNicolas Bonnefon 54458a6a73SNicolas Bonnefon_glogg_ can display and search through logs while they are written to disk, as 55458a6a73SNicolas Bonnefonit might be the case when debugging a running program or server. 56*0cca3299SNicolas BonnefonThe log is automatically updated when it grows, but the 'Auto-refresh' option 57*0cca3299SNicolas Bonnefonmust be enabled if you want the search results to be automatically refreshed as 58*0cca3299SNicolas Bonnefonwell. 59*0cca3299SNicolas Bonnefon 60*0cca3299SNicolas BonnefonThe 'f' key might be used to follow the end of the file as it grows (_a la_ 61*0cca3299SNicolas Bonnefon`tail -f`). 62458a6a73SNicolas Bonnefon 63458a6a73SNicolas Bonnefon## Settings 64458a6a73SNicolas Bonnefon### Font 65458a6a73SNicolas Bonnefon 66458a6a73SNicolas BonnefonThe font used to display the log file. A clear, monospace font (like the free, 67458a6a73SNicolas Bonnefonopen source, [DejaVu Mono](http://www.dejavu-fonts.org/) for example) is 68458a6a73SNicolas Bonnefonrecommended. 69458a6a73SNicolas Bonnefon 70*0cca3299SNicolas Bonnefon### Search options 71*0cca3299SNicolas Bonnefon 72*0cca3299SNicolas BonnefonDetermines which type of regular expression _glogg_ will use when filtering 73*0cca3299SNicolas Bonnefonlines for the bottom window, and when using QuickFind. 74*0cca3299SNicolas Bonnefon 75*0cca3299SNicolas Bonnefon* Extended Regexp: the default, uses regular expressions similar to those used by Perl 76*0cca3299SNicolas Bonnefon* Wildcards: uses wildcards (\*, ? and []) in a similar fashion as a Unix shell 77*0cca3299SNicolas Bonnefon* Fixed Strings: searches for the text exactly as it is written, no character is special 78*0cca3299SNicolas Bonnefon 7959d49dccSNicolas Bonnefon## Keyboard commands 80458a6a73SNicolas Bonnefon 81591a260cSNicolas Bonnefon_glogg_ keyboard commands try to approximatively emulate the default bindings 82591a260cSNicolas Bonnefonused by the classic Unix utilities _vi_ and _less_. 8359d49dccSNicolas Bonnefon 8459d49dccSNicolas BonnefonThe main commands are: 8559d49dccSNicolas Bonnefon<table> 8659d49dccSNicolas Bonnefon<tr><td>arrows</td> 8759d49dccSNicolas Bonnefon <td>scroll one line up/down or one column left/right</td></tr> 885c8b745aSNicolas Bonnefon<tr><td>[number] j/k</td> 895c8b745aSNicolas Bonnefon <td>move the selection 'number' (or one) line down/up</td></tr> 9059d49dccSNicolas Bonnefon<tr><td>h/l</td> 9159d49dccSNicolas Bonnefon <td>scroll left/right</td></tr> 925c8b745aSNicolas Bonnefon<tr><td>[number] g</td> 935c8b745aSNicolas Bonnefon <td>jump to the line number given or the first one if no number is entered</td></tr> 945c8b745aSNicolas Bonnefon<tr><td>G</td> 955c8b745aSNicolas Bonnefon <td>jump to the last line of the file (selecting it)</td></tr> 96591a260cSNicolas Bonnefon<tr><td>/</td> 97591a260cSNicolas Bonnefon <td>start a quickfind search in the current screen</td></tr> 98591a260cSNicolas Bonnefon<tr><td>n/N</td> 99591a260cSNicolas Bonnefon <td>repeat the previous quickfind search forward/backward</td></tr> 100d01f5507SNicolas Bonnefon<tr><td>*/#</td> 101d01f5507SNicolas Bonnefon <td>search for the next/previous occurence of the currently selected text</td></tr> 102591a260cSNicolas Bonnefon<tr><td>f</td> 103d01f5507SNicolas Bonnefon <td>activate 'follow' mode, which keep the display as the tail of the file (like "tail -f")</td></tr> 10459d49dccSNicolas Bonnefon</table> 105