Link | log_clf |
Author | Jason Huck |
Category | Utility |
Version | 8.x |
License | http://opensource.org/licenses/artistic-license.php |
Posted | 21 Dec 2005 |
Updated | 16 Jan 2006 |
More by this author... |
This tag was co-written with Alex Pilson, and was designed to give the developer more control over access logs. Potential uses include writing logs only for specific pages (i.e. to supply to advertisors) or controlling the url that gets logged (for instance, with one-file type systems that do not use a url-rewriting scheme, where otherwise all your log entries would be for /index.lasso). Writes in Apache Combined Log Format.
Requires the path to the log file and optionally accepts a custom filename. (Otherwise uses [response_filepath].)
For accurate bytes logging, must be called via [define_atend]. (see example)
define_atend({ log_clf( -path='/access.txt'); });
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define_tag( 'clf', -namespace='log_', -required='path', -type='string', -optional='filename', -type='string', -priority='replace', -description='Writes page stats to a file in Apache Combined Log Format.' ); local( 'username' = (client_username ? client_username | '-'), 'protocol' = $__http_header__->split('\r\n')->get(1)->substring(1,8), 'status' = $__http_header__->split('\r\n')->get(1)->substring(10,3), 'content_length' = bytes($__html_reply__)->size, 'timestamp' = date->format('[%d/%b/%Y:%T %z]'), 'referrer' = (referrer_url == '' ? '-' | referrer_url), 'cookies' = (client_cookielist ? ('"' + client_cookielist + '"') | '') ); !local_defined('filepath') ? local('filepath' = response_filepath); log(#path); client_ip + ' - ' + #username + ' ' + #timestamp + ' "' + client_formmethod + ' ' + #filepath + ' ' + #protocol + '" ' + #status + ' ' + #content_length + ' "' + #referrer + '" "' + client_browser + '" ' + #cookies + '\n'; /log; /define_tag;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft