Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / log4js / examples / smtp-appender.js
1 //Note that smtp appender needs nodemailer to work.
2 //If you haven't got nodemailer installed, you'll get cryptic
3 //"cannot find module" errors when using the smtp appender
4 var log4js = require('../lib/log4js')
5 , log
6 , logmailer
7 , i = 0;
8 log4js.configure({
9   "appenders": [
10     {
11       type: "console",
12       category: "test"
13     },
14     {
15       "type": "smtp",
16       "recipients": "logfilerecipient@logging.com",
17       "sendInterval": 5,
18       "transport": "SMTP",
19       "SMTP": {
20         "host": "smtp.gmail.com",
21         "secureConnection": true,
22         "port": 465,
23         "auth": {
24           "user": "someone@gmail",
25           "pass": "********************"
26         },
27         "debug": true
28       },
29       "category": "mailer"
30     }
31   ]
32 });
33 log = log4js.getLogger("test");
34 logmailer = log4js.getLogger("mailer");
35
36 function doTheLogging(x) {
37     log.info("Logging something %d", x);
38     logmailer.info("Logging something %d", x);
39 }
40
41 for ( ; i < 500; i++) {
42     doTheLogging(i);
43 }