# Seq
This tutorial shows you how you can configure Seq logger with Ts.ED. Seq is centralized structured logs for NodeJS, .NET, Java etc.
# Installation
Run this command to install required dependencies by @tsed/seq
:
npm install --save @tsed/seq bunyan bunyan-seq @types/bunyan @types/bunyan-seq
1
Then add the following configuration in your Server:
import {Configuration} from "@tsed/common";
import "@tsed/seq"; // import seq Ts.ED module
@Configuration({
rootDir: __dirname,
seq: {
url: "http://localhost:5341"
}
})
export class Server {
}
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Note
Seq module uses the @tsed/logger as a default system logger
Note
Seq module uses the log level from the (default level is debug)
# Example
import {Controller, Get, QueryParams} from "@tsed/common";
import {$log} from "@tsed/logger";
@Controller('/calendars')
export class Calendar {
@Get('/:id')
async getCalendar(@QueryParams('id') id: string): Promise<CalendarModel> {
$log.info(id);
}
}
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Then we should see the log in the Seq panel (by default localhost:5341
)
# Author
# Maintainers
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing