How to use the auditLogger function from restify

Find comprehensive JavaScript restify.auditLogger code examples handpicked from public code repositorys.

208
209
210
211
212
213
214
215
216
217
        var _t = Math.floor((1000000 * t[0]) +
                            (t[1] / 1000));
        timers[time.name] = _t;
});

restify.auditLogger({
    log: req.log.child({ route: route }, true),
    body: body,
    timers: timers
})(req, res, route, err);
fork icon71
star icon449
watch icon0

98
99
100
101
102
103
104
105
106
107
108
109
110


/**
 * Request / Response Logging
 */


server.on('after', restify.auditLogger({
  log: Logger
}));


/**
fork icon25
star icon70
watch icon0

129
130
131
132
133
134
135
136
137
138
    null, mod_path.join(filespath, 'index.htm')));
klServer.get('/resources/.*', dirServer.bind(null, '/resources/',
    mod_path.join(filespath, 'resources')));
klServer.post('/kart/video', auth, upload);

klServer.on('after', mod_restify.auditLogger({ 'log': klLog }));

klServer.listen(klPort, function () {
        klLog.info('%s server listening at %s',
            klServer.name, klServer.url);
fork icon8
star icon77
watch icon12

+ 3 other calls in file

28
29
30
31
32
33
34
35
36
self.server = restify.createServer({
    name: app_name,
    log: logger
});

self.server.on('after', restify.auditLogger({
    name: 'audit',
    log: logger
}));
fork icon14
star icon52
watch icon7

+ 3 other calls in file

117
118
119
120
121
122
123
124
125
126
        req.ufds = self.ufds_client;
        next();
    }
});

server.on('after', restify.auditLogger({log: log}));

// Show
server.get('/customers', customers.operators, customers.list);
server.head('/customers', customers.operators, customers.list);
fork icon8
star icon6
watch icon0

143
144
145
146
147
148
149
150
151
152
    var auditLogger = new Logger({
        name: 'audit',
        streams: [ { level: 'info', stream: process.stdout } ]
    });

    server.on('after', restify.auditLogger({ log: auditLogger }));
}

/*
 * Set handers for routes.
fork icon6
star icon2
watch icon34

184
185
186
187
188
189
190
191
192
193
var init_restify = function (_, next) {
        server.use(mod_restify.acceptParser(server.acceptable));
        server.use(mod_restify.queryParser());
        server.use(mod_restify.bodyParser({ 'mapParams': false }));

        server.on('after', mod_restify.auditLogger({
                log: log.child({ component: 'AuditLog' })
        }));

        server.on('uncaughtException', mod_common.restifyPanic);
fork icon5
star icon2
watch icon43

+ 3 other calls in file

280
281
282
283
284
285
286
287
288
289
pkg_server.get(RegExp('^' + pkg_prefix + '/.+'), staticfunc);

/*
 * Enable logging.
 */
pkg_server.on('after', mod_restify.auditLogger({
	log: mod_bunyan.createLogger({
		name: 'audit',
		stream: process.stdout
	})
fork icon0
star icon0
watch icon0

+ 2 other calls in file

65
66
67
68
69
70
71
72
73
74
75
76
        req.headers['X-Access-Token'] = req.headers['x-access-token']; // eslint-disable-line
    }
    return next();
});


RestServer.on('after', Restify.auditLogger({
    log: RestLogger,
}));


// Export this for Socket.io to make use of.
fork icon0
star icon0
watch icon0

+ 4 other calls in file

35
36
37
38
39
40
41
42
43
44
//     properties: {
//         foo: 'bar'
//     },
//     serializers:bunyan.stdSerializers
// }));
// server.on('after', restify.auditLogger({
//     log: bunyan.createLogger({
//         name: 'auditLogger',
//         stream: process.stdout
//     })
fork icon0
star icon0
watch icon8