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. 56458a6a73SNicolas BonnefonThe log is automatically updated when it grows, but the search must be 57458a6a73SNicolas Bonnefonmanually restarted for the new matches to be found. 58458a6a73SNicolas Bonnefon 59458a6a73SNicolas Bonnefon## Settings 60458a6a73SNicolas Bonnefon### Font 61458a6a73SNicolas Bonnefon 62458a6a73SNicolas BonnefonThe font used to display the log file. A clear, monospace font (like the free, 63458a6a73SNicolas Bonnefonopen source, [DejaVu Mono](http://www.dejavu-fonts.org/) for example) is 64458a6a73SNicolas Bonnefonrecommended. 65458a6a73SNicolas Bonnefon 6659d49dccSNicolas Bonnefon## Keyboard commands 67458a6a73SNicolas Bonnefon 68591a260cSNicolas Bonnefon_glogg_ keyboard commands try to approximatively emulate the default bindings 69591a260cSNicolas Bonnefonused by the classic Unix utilities _vi_ and _less_. 7059d49dccSNicolas Bonnefon 7159d49dccSNicolas BonnefonThe main commands are: 7259d49dccSNicolas Bonnefon<table> 7359d49dccSNicolas Bonnefon<tr><td>arrows</td> 7459d49dccSNicolas Bonnefon <td>scroll one line up/down or one column left/right</td></tr> 75*5c8b745aSNicolas Bonnefon<tr><td>[number] j/k</td> 76*5c8b745aSNicolas Bonnefon <td>move the selection 'number' (or one) line down/up</td></tr> 7759d49dccSNicolas Bonnefon<tr><td>h/l</td> 7859d49dccSNicolas Bonnefon <td>scroll left/right</td></tr> 79*5c8b745aSNicolas Bonnefon<tr><td>[number] g</td> 80*5c8b745aSNicolas Bonnefon <td>jump to the line number given or the first one if no number is entered</td></tr> 81*5c8b745aSNicolas Bonnefon<tr><td>G</td> 82*5c8b745aSNicolas Bonnefon <td>jump to the last line of the file (selecting it)</td></tr> 83591a260cSNicolas Bonnefon<tr><td>/</td> 84591a260cSNicolas Bonnefon <td>start a quickfind search in the current screen</td></tr> 85591a260cSNicolas Bonnefon<tr><td>n/N</td> 86591a260cSNicolas Bonnefon <td>repeat the previous quickfind search forward/backward</td></tr> 87591a260cSNicolas Bonnefon<tr><td>f</td> 88591a260cSNicolas Bonnefon <td>active 'follow' mode, which keep the display as the tail of the file (like "tail -f")</td></tr> 8959d49dccSNicolas Bonnefon</table> 90