log_this

7.0.2 • Public • Published

log something text, object, error to json file

Installation

package.json
 
{
    "dependencies"{
        "log_this":"*"
    }
}
 
$ npm install

Use it

var logger = require("logger");
applications_collections.find({"_id": http_request}, function(error, application){
    if(error){
        logger.error(error);
    } 
});

output

{
    "date": "Sat Mar 26 2016 01:53:51 GMT+0000 (UTC)",
    "process": {
        "pid": 3080,
        "uid": 1000,
        "gid": 1000,
        "cwd": "/home/ubuntu/workspace",
        "execPath": "/home/ubuntu/.nvm/versions/node/v4.4.0/bin/node",
        "version": "v4.4.0",
        "argv": ["/home/ubuntu/.nvm/versions/node/v4.4.0/bin/node", "/home/ubuntu/workspace/app.js"],
        "memoryUsage": {
            "rss": 56913920,
            "heapTotal": 38330720,
            "heapUsed": 22841272
        }
    },
    "os": {
        "loadavg": [3.30322265625, 2.5859375, 2.7646484375],
        "uptime": 226629
    },
    "trace": [{
        "column": 9,
        "file": "buffer.js",
        "function": "Function.Buffer.concat",
        "line": 240,
        "method": "Buffer.concat",
        "native": false
    }, {
        "column": 25,
        "file": "/home/ubuntu/workspace/node_modules/log_me/index.js",
        "function": "ServerResponse.logIt",
        "line": 18,
        "method": "logIt",
        "native": false
    }, {
        "column": 16,
        "file": "events.js",
        "function": "ServerResponse.g",
        "line": 260,
        "method": "g",
        "native": false
    }, {
        "column": 20,
        "file": "events.js",
        "function": "emitNone",
        "line": 72,
        "method": null,
        "native": false
    }, {
        "column": 7,
        "file": "events.js",
        "function": "ServerResponse.emit",
        "line": 166,
        "method": "emit",
        "native": false
    }, {
        "column": 10,
        "file": "_http_outgoing.js",
        "function": "finish",
        "line": 559,
        "method": null,
        "native": false
    }, {
        "column": 9,
        "file": "node.js",
        "function": "nextTickCallbackWith0Args",
        "line": 420,
        "method": null,
        "native": false
    }, {
        "column": 13,
        "file": "node.js",
        "function": "process._tickCallback",
        "line": 349,
        "method": "_tickCallback",
        "native": false
    }],
    "stack": ["TypeError: buf.copy is not a function", "    at Function.Buffer.concat (buffer.js:240:9)", "    at ServerResponse.logIt (/home/ubuntu/workspace/node_modules/log_me/index.js:18:25)", "    at ServerResponse.g (events.js:260:16)", "    at emitNone (events.js:72:20)", "    at ServerResponse.emit (events.js:166:7)", "    at finish (_http_outgoing.js:559:10)", "    at nextTickCallbackWith0Args (node.js:420:9)", "    at process._tickCallback (node.js:349:13)"],
    "level": "error",
    "message": "uncaughtException: buf.copy is not a function",
    "timestamp": "2016-03-26T01:53:51.365Z"
}
 

Readme

Keywords

Package Sidebar

Install

npm i log_this

Weekly Downloads

2

Version

7.0.2

License

ISC

Last publish

Collaborators

  • geniusescode