-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.ts
30 lines (26 loc) · 739 Bytes
/
app.ts
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
import pino from 'pino';
const transport = pino.transport({
targets: [
{
target: '../src/index.ts',
level: 'error',
options: {
webhookUrl: 'https://hooks.slack.com/services/xxx/xxx/xxx',
channel: '#error-noti',
username: 'testuser',
iconEmoji: 'testemoji',
verbose: true,
},
},
{
target: 'pino-pretty',
level: 'debug',
options: { destination: 1 },
},
],
});
const now = new Date();
const logger = pino({ level: 'debug' }, transport);
logger.debug('debug log!', now);
logger.info('info log!', now);
logger.error('error log!', now);