Skip to content

Commit 1599fdf

Browse files
committed
Check traces with express server
1 parent 05a0282 commit 1599fdf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

index.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
import tracer from "dd-trace";
2+
import express from 'express';
13
import {BuffLog} from './bufflog';
24

5+
tracer.init({
6+
hostname: "dd-agent-hostname",
7+
logInjection: false
8+
});
9+
310
let logger = new BuffLog();
411

512
logger.info('hello info');
@@ -8,3 +15,20 @@ logger.notice('hello notice');
815
logger.warning('hello warning');
916
logger.error('hello error');
1017
logger.critical('hello critical');
18+
19+
const app = express();
20+
21+
app.listen(4000, () => {
22+
console.log(`Server is listening on port 4000`);
23+
});
24+
25+
app.get('/', (req, res) => {
26+
var logger = new BuffLog();
27+
logger.notice("Notice log via endpoint");
28+
logger.info('hello info');
29+
logger.debug('hello debug');
30+
logger.notice('hello notice');
31+
logger.warning('hello warning');
32+
logger.error('hello error');
33+
logger.critical('hello critical');
34+
});

0 commit comments

Comments
 (0)