tips:logging
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:logging [2009-03-13 08:19] – Fixed link to plugin 77.184.205.40 | tips:logging [2017-09-25 13:43] (current) – old revision restored (2016-02-09 08:16) bactram | ||
---|---|---|---|
Line 5: | Line 5: | ||
I will describe two versions. The first is the high end solution and will log access to wiki pages and also to the internal and external media files. The second one is for " | I will describe two versions. The first is the high end solution and will log access to wiki pages and also to the internal and external media files. The second one is for " | ||
- | :!: [note by J.-F. Lalande] Using the information and code provided on this page, I created the [[plugin: | + | :!: [note by J.-F. Lalande] Using the information and code provided on this page, I created the [[plugin: |
===== Log File Format ===== | ===== Log File Format ===== | ||
- | Both solutions will use the NCSA combined or NCSA extended log file format. This log file format is very popular and often used be web servers like apache. Many report generators can read this format and create nice reports from it. Because of this fantastic support by external programs Dokuwiki doesn' | + | Both solutions will use the NCSA combined or NCSA extended log file format. This log file format is very popular and often used on web servers like apache. Many report generators can read this format and create nice reports from it. Because of this fantastic support by external programs Dokuwiki doesn' |
Report generators that could be used are (only some examples, list far from complete): | Report generators that could be used are (only some examples, list far from complete): | ||
Line 25: | Line 24: | ||
* < | * < | ||
* < | * < | ||
- | * < | + | * < filesize > - size of the wiki page (only the bare text) |
* < | * < | ||
* < | * < | ||
Line 40: | Line 39: | ||
<code php> | <code php> | ||
function init_paths(){ | function init_paths(){ | ||
- | | + | |
- | | + | |
- | | + | ' |
- | | + | ' |
- | | + | ' |
- | | + | ' |
- | | + | ' |
- | | + | |
- | | + | 'tmpdir' |
+ | ' | ||
+ | |||
+ | foreach($paths as $c => $p){ | ||
+ | if(empty($conf[$c])) | ||
+ | $conf[$c] | ||
+ | if($c != ' | ||
+ | You should check your config and permission settings. | ||
+ | Or maybe you want to <a href=\" | ||
+ | installer</ | ||
+ | } | ||
- | foreach($paths as $c => $p){ | + | [...] |
- | if(!$conf[$c]) | + | |
- | $conf[$c] = init_path($conf[$c]); | + | |
- | if($c != ' | + | |
- | die(" | + | |
- | } | + | |
- | } | + | |
</ | </ | ||
Line 65: | Line 68: | ||
<code php> | <code php> | ||
- | | + | if(!defined(' |
- | require_once(DOKU_INC.' | + | require_once(DOKU_INC.' |
- | require_once(DOKU_CONF.' | + | |
[...] | [...] | ||
Line 84: | Line 86: | ||
</ | </ | ||
- | 4. Update your favorite template to call // | + | 4. Update your favorite template to call // |
+ | |||
+ | <code php> | ||
+ | |||
+ | [...] | ||
+ | |||
+ | </ | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
- | 5. To be able to log media files too we need to modify /// | + | 5. To be able to log media files too we need to modify /// |
<code php> | <code php> | ||
Line 159: | Line 173: | ||
Source code of // | Source code of // | ||
- | <code php> | + | <code php logfile.php |
+ | > | ||
<?php | <?php | ||
/** | /** | ||
Line 306: | Line 321: | ||
If you choose to use AWStats to process your logs, then here are some tips on configuration options that give you some more control over how DokuWiki accesses are shown. | If you choose to use AWStats to process your logs, then here are some tips on configuration options that give you some more control over how DokuWiki accesses are shown. | ||
- | * By defualt, AWStats does not keep track of the parameters after a "?" | + | * By default, AWStats does not keep track of the parameters after a "?" |
< | < | ||
URLWithQuery=1 # Set this to " | URLWithQuery=1 # Set this to " | ||
Line 350: | Line 365: | ||
ExtraSectionName3=" | ExtraSectionName3=" | ||
- | ExtraSectionCodeFilter3=" | + | ExtraSectionCodeFilter3=" |
- | ExtraSectionCondition3=" | + | ExtraSectionCondition3=" |
- | ExtraSectionFirstColumnTitle3=" | + | ExtraSectionFirstColumnTitle3=" |
- | ExtraSectionFirstColumnValues3=" | + | ExtraSectionFirstColumnValues3=" |
- | ExtraSectionFirstColumnFormat3="< | + | ExtraSectionFirstColumnFormat3="< |
ExtraSectionStatTypes3=PHBL | ExtraSectionStatTypes3=PHBL | ||
ExtraSectionAddAverageRow3=0 | ExtraSectionAddAverageRow3=0 | ||
- | ExtraSectionAddSumRow3=1 | ||
- | MaxNbOfExtra3=10 | ||
- | MinHitExtra3=1 | ||
</ | </ | ||
+ | |||
+ | ===== Discussion ===== | ||
+ | Is it possible to save searches in a log file? | ||
+ | |||
+ | I agree that that would be very helpful to be able to have in the log file rather than having to check the apache logs. Dopple 25/08/2009 | ||
tips/logging.1236928746.txt.gz · Last modified: 2009-07-13 10:36 (external edit)