Sha256: 4fb7d15b3ca3cf9b19cc5f4fe1f61ff91e9eb333f481de7b6ae778e6650ef98c

Contents?: true

Size: 985 Bytes

Versions: 17

Compression:

Stored size: 985 Bytes

Contents

//Note that smtp appender needs nodemailer to work.
//If you haven't got nodemailer installed, you'll get cryptic
//"cannot find module" errors when using the smtp appender
var log4js = require('../lib/log4js')
, log
, logmailer
, i = 0;
log4js.configure({
  "appenders": [
    {
      type: "console",
      category: "test"
    },
    {
      "type": "smtp",
      "recipients": "logfilerecipient@logging.com",
      "sendInterval": 5,
      "transport": "SMTP",
      "SMTP": {
        "host": "smtp.gmail.com",
        "secureConnection": true,
        "port": 465,
        "auth": {
          "user": "someone@gmail",
          "pass": "********************"
        },
        "debug": true
      },
      "category": "mailer"
    }
  ]
});
log = log4js.getLogger("test");
logmailer = log4js.getLogger("mailer");

function doTheLogging(x) {
    log.info("Logging something %d", x);
    logmailer.info("Logging something %d", x);
}

for ( ; i < 500; i++) {
    doTheLogging(i);
}

Version data entries

17 entries across 17 versions & 2 rubygems

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