-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ts
More file actions
34 lines (28 loc) · 816 Bytes
/
index.ts
File metadata and controls
34 lines (28 loc) · 816 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
34
import tracer from "dd-trace";
import express from 'express';
import {BuffLog} from './bufflog';
tracer.init({
hostname: "dd-agent-hostname",
logInjection: false
});
let logger = new BuffLog();
logger.info('hello info');
logger.debug('hello debug');
logger.notice('hello notice');
logger.warning('hello warning');
logger.error('hello error');
logger.critical('hello critical');
const app = express();
app.listen(4000, () => {
console.log(`Server is listening on port 4000`);
});
app.get('/', (req, res) => {
var logger = new BuffLog();
logger.notice("Notice log via endpoint");
logger.info('hello info');
logger.debug('hello debug');
logger.notice('hello notice');
logger.warning('hello warning');
logger.error('hello error');
logger.critical('hello critical');
});