0.0
No commit activity in last 3 years
No release in over 3 years
This gem module provides a logger class and a log formatter class that will create a log file in a common log format. A ruby based application can generate a log file record with each page visit. This capability provides logging that can be highly customized by the ruby developer. A web log analyzer will be needed to summarize and analyze the web log records
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

ViziLogger¶ ↑

Introduction¶ ↑

This gem module creates a pagelogger that can used to log the visit to each web page in a Ruby based web application (e.g., Ramaze, Rails). Each web page is logged in Common Log Format to support analysis by an external Web Log Analyzer

Installation¶ ↑

Just run:

gem install vizi_logger

The following code will simulate the implementation of the software in a Ruby based web application. When used in a web application, the pagelogger should be called with the following:

weblog.page page_url # where page_url provides the url information

The following example will allow for the testing of the gem in your development environment.

You will need a Web Log Analyzer program to review the results of your application logging. The output of this gem has been tested with the Summary web log analyzer. Check it out at www.summary.net.

Usage¶ ↑

Here is the testit application:

require 'rubygems'   # needed for ruby 1.8.7
require 'vizi_logger'
# weblog = Vizi::PageLogger.new(STDOUT)
weblog = Vizi::PageLogger.new('./log/vizidemo.log',shift_age = 'weekly')
weblog.addremote '127.0.0.1'  # for batch testing
# weblog.addremote request.remote_addr  # use this in live mode
weblog.formatter=Vizi::LogFormatter.new
urlist = ["/","/users/login","/users/list","/posts","/posts/view/1"]
25.times do
    sleep rand*2  # create random interval
    page_url = urlist[(5*rand).to_i]  # select a random page url
    weblog.page page_url
end

License¶ ↑

This code is made available under the MIT license.