-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ts
More file actions
33 lines (28 loc) · 907 Bytes
/
index.ts
File metadata and controls
33 lines (28 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import tracer from "dd-trace";
import express from 'express';
import bufflog from './bufflog';
tracer.init({
hostname: "dd-agent-hostname",
// will automatically append the traces to BuffLog
logInjection: true
});
bufflog.info('hello info');
bufflog.notice('hello notice');
bufflog.notice('hello notice with context', {"test":"toto"});
bufflog.warning('hello warning');
bufflog.error('hello error');
bufflog.critical('hello critical');
bufflog.critical('hello critical', {"some":"stuff"});
const app = express();
app.listen(4000, () => {
console.log(`Server is listening on port 4000`);
});
app.get('/', (req, res) => {
bufflog.notice("Notice log via endpoint");
bufflog.info('hello info');
bufflog.debug('hello debug');
bufflog.notice('hello notice');
bufflog.warning('hello warning');
bufflog.error('hello error');
bufflog.critical('hello critical');
});