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 43*02e99a77SNicolas BonnefonIn addition to the filtered window, the match overview on the right hand side 44*02e99a77SNicolas Bonnefonof the screen offers a view of the position of matches in the log file. Matches 45*02e99a77SNicolas Bonnefonare showed as small red lines. 46*02e99a77SNicolas Bonnefon 47458a6a73SNicolas Bonnefon## Using filters 48458a6a73SNicolas Bonnefon 49458a6a73SNicolas Bonnefon_Filters_ can colorize some lines of the log being displayed, for example to 50458a6a73SNicolas Bonnefondraw attention to lines indicating an error, or to associate a color with each 51458a6a73SNicolas Bonnefonsort of event. Any number of filter can be defined in the 'Filters' 52458a6a73SNicolas Bonnefonconfiguration dialog, each using a regexp against which lines will be matched. 53458a6a73SNicolas BonnefonFor each line, all filters are tried in order and the fore and back colors of 54458a6a73SNicolas Bonnefonthe first successful filter are applied. 55458a6a73SNicolas Bonnefon 56*02e99a77SNicolas Bonnefon## Marking lines in the log file 57*02e99a77SNicolas Bonnefon 58*02e99a77SNicolas BonnefonIn addition to regexp matches, _glogg_ enable the user to mark any interesting 59*02e99a77SNicolas Bonnefonline in the log. To do this, click on the round bullet in the left margin in 60*02e99a77SNicolas Bonnefonfront of the line that needs to be marked. 61*02e99a77SNicolas Bonnefon 62*02e99a77SNicolas BonnefonMarks are combined with matches and showed in the filtered window. They also 63*02e99a77SNicolas Bonnefonappears as blue lines in the match overview. 64*02e99a77SNicolas Bonnefon 65458a6a73SNicolas Bonnefon## Browsing changing log files 66458a6a73SNicolas Bonnefon 67458a6a73SNicolas Bonnefon_glogg_ can display and search through logs while they are written to disk, as 68458a6a73SNicolas Bonnefonit might be the case when debugging a running program or server. 690cca3299SNicolas BonnefonThe log is automatically updated when it grows, but the 'Auto-refresh' option 700cca3299SNicolas Bonnefonmust be enabled if you want the search results to be automatically refreshed as 710cca3299SNicolas Bonnefonwell. 720cca3299SNicolas Bonnefon 730cca3299SNicolas BonnefonThe 'f' key might be used to follow the end of the file as it grows (_a la_ 740cca3299SNicolas Bonnefon`tail -f`). 75458a6a73SNicolas Bonnefon 76458a6a73SNicolas Bonnefon## Settings 77458a6a73SNicolas Bonnefon### Font 78458a6a73SNicolas Bonnefon 79458a6a73SNicolas BonnefonThe font used to display the log file. A clear, monospace font (like the free, 80458a6a73SNicolas Bonnefonopen source, [DejaVu Mono](http://www.dejavu-fonts.org/) for example) is 81458a6a73SNicolas Bonnefonrecommended. 82458a6a73SNicolas Bonnefon 830cca3299SNicolas Bonnefon### Search options 840cca3299SNicolas Bonnefon 850cca3299SNicolas BonnefonDetermines which type of regular expression _glogg_ will use when filtering 860cca3299SNicolas Bonnefonlines for the bottom window, and when using QuickFind. 870cca3299SNicolas Bonnefon 880cca3299SNicolas Bonnefon* Extended Regexp: the default, uses regular expressions similar to those used by Perl 890cca3299SNicolas Bonnefon* Wildcards: uses wildcards (\*, ? and []) in a similar fashion as a Unix shell 900cca3299SNicolas Bonnefon* Fixed Strings: searches for the text exactly as it is written, no character is special 910cca3299SNicolas Bonnefon 9259d49dccSNicolas Bonnefon## Keyboard commands 93458a6a73SNicolas Bonnefon 94591a260cSNicolas Bonnefon_glogg_ keyboard commands try to approximatively emulate the default bindings 95591a260cSNicolas Bonnefonused by the classic Unix utilities _vi_ and _less_. 9659d49dccSNicolas Bonnefon 9759d49dccSNicolas BonnefonThe main commands are: 9859d49dccSNicolas Bonnefon<table> 9959d49dccSNicolas Bonnefon<tr><td>arrows</td> 10059d49dccSNicolas Bonnefon <td>scroll one line up/down or one column left/right</td></tr> 1015c8b745aSNicolas Bonnefon<tr><td>[number] j/k</td> 1025c8b745aSNicolas Bonnefon <td>move the selection 'number' (or one) line down/up</td></tr> 10359d49dccSNicolas Bonnefon<tr><td>h/l</td> 10459d49dccSNicolas Bonnefon <td>scroll left/right</td></tr> 1055c8b745aSNicolas Bonnefon<tr><td>[number] g</td> 1065c8b745aSNicolas Bonnefon <td>jump to the line number given or the first one if no number is entered</td></tr> 1075c8b745aSNicolas Bonnefon<tr><td>G</td> 1085c8b745aSNicolas Bonnefon <td>jump to the last line of the file (selecting it)</td></tr> 109591a260cSNicolas Bonnefon<tr><td>/</td> 110591a260cSNicolas Bonnefon <td>start a quickfind search in the current screen</td></tr> 111591a260cSNicolas Bonnefon<tr><td>n/N</td> 112591a260cSNicolas Bonnefon <td>repeat the previous quickfind search forward/backward</td></tr> 113d01f5507SNicolas Bonnefon<tr><td>*/#</td> 114d01f5507SNicolas Bonnefon <td>search for the next/previous occurence of the currently selected text</td></tr> 115591a260cSNicolas Bonnefon<tr><td>f</td> 116d01f5507SNicolas Bonnefon <td>activate 'follow' mode, which keep the display as the tail of the file (like "tail -f")</td></tr> 11759d49dccSNicolas Bonnefon</table> 118