forked from mirrors/Scribe.js
No description
__misc | ||
src | ||
.gitattributes | ||
.gitignore | ||
LICENSE | ||
log.html | ||
README.md |

Lightweight NodeJS Logging Overview
Unlike many of the libraries out there, Scribe.js allows logging on multiple files and is divided into folders by date. And it is possibly the easiest logging you can implement. And it does everything you need a basic logger to do.
- Save messages into log files organized by user, date, and type
- Print messages into console using colors indicating level of importance
Output Methods (Web | Console | File)
Method#Web - Select Date
Method#Web - Select Log Type
Method#Web - View Logs
Method#Console - Command Prompt
Method#File - File
Method#File - Directory Layout
How to use Scribe.js
Using Sribe is as simple as putting the contents of the Scribe folder into your root NodeJS folder. Note: What I am about to show you is the simplest way to use Scribe.js. Since this library (if you can even call it that), is not insave at all, and it should be very easy to adjust to your liking.
- Make a Scribe directory
\root
\node_modules
\views
\controllers
\bunchOfOtherFolder...
\scribe <--- Make a folder named "scribe"
app.js
- Add Scribe into this folder
\scribe <--- Copy the contents of the "src" folder (which you get from this repo) into "scribe".
- Add Scribe into the
app.js
var scribe = require('./scribe'); <---- On the very top of your application.
- Install the required modules
npm install colors
npm install moment
npm install mkdirp
- Logging with Scribe
// You can use any of the following anywhere Scribe will
// both SAVE to file and PRINT to console whatever
console.log("[Tagname]Simple message");
console.info("[Tagname]Simple message");
console.warn("[Tagname]Simple message");
console.error("[Tagname]Simple message");
console.realtime("[Tagname]Simple message");
console.high("[Tagname]Simple message");
console.normal("[Tagname]Simple message");
console.low("[Tagname]Simple message");
- Using Scribe and Express
// Inside app.js
app.configure(function () {
app.use(scribe.express.logger);
}
// Enable Web Control Panel
app.get('/log', scribe.express.getlog);
Contributors
bluejamesbond