visitas
v1.0.1
Published
Simple Node.js dashboard for clf logs analysis, with logging capabilities.
Downloads
12
Maintainers
Readme
visitas.js
Simple Node.js dashboard for clf logs analysis, with logging capabilities.
Demo images
Requirements
Node
npm
- A
Mongo
connection
Installation
Simply install visitas
via npm:
npm install --save visitas
And then edit the file app.js
, registering visitas
before any route:
var visitas = require('visitas');
app.use(visitas( {MONGO CONNECTION}, {OPTIONS} ));
Configuration
Mongo connection properties:
host
(required)port
(required)db
(required)user
password
Options:
log
(boolean/object):visitas
can also store the logs for the application. This property acceptsfalse
if no logging behaviour is required, or an object of options:filename
(string): Filename prefix for the logs [defaultaccess
]rotation
(boolean): Use daily rotation [defaultfalse
]directory
(string): Directory for the logs [defaultnode_moduls\visitas\log
]
dashboard
(boolean/string): Dashboard endpoint [default/visitas/
]
Simple test
First, init the template project and install visitas
express visitas-test
cd visitas-test && npm install
npm install --save visitas
... and edit the file app.js
registering visitas
, before any route is registered:
var visitas = require('visitas');
app.use(visitas({
host: 'localhost',
port: 27017,
db: 'visitas'
}));
Generate some logs:
node node_modules/visitas/generate-logs.js
The script also admits parameters:
node path/to/generate-logs.js [number of logs, default 1000] [directory, default visitas/log]
Finally, start the application...
npm start
And browse to http://127.0.0.1:3000/visitas