Sha256: f49409f7773394c59d00072b85f394e45ab7efc95c42d8f2452a2554140e87e3

Contents?: true

Size: 715 Bytes

Versions: 17

Compression:

Stored size: 715 Bytes

Contents

/**
 * run this, then "ab -c 10 -n 100 localhost:4444/" to test (in
 * another shell)
 */
var log4js = require('../lib/log4js');
log4js.configure({
      appenders: [
        { type: 'file', filename: 'cheese.log', category: 'cheese' },
        { type: 'console'}
  ]
});

var logger = log4js.getLogger('cheese');
logger.setLevel('INFO');

var http=require('http');

var server = http.createServer(function(request, response){
    response.writeHead(200, {'Content-Type': 'text/plain'});
    var rd = Math.random() * 50;
    logger.info("hello " + rd);
    response.write('hello ');
    if (Math.floor(rd) == 30){
        log4js.shutdown(function() { process.exit(1); });
    }
    response.end();
}).listen(4444);

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/flush-on-exit.js