# 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

Note

Seq module uses the @tsed/logger (opens new window) as a default system logger

Note

Seq module uses the log level from the PlatformLoggerSettings (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

Then we should see the log in the Seq panel (by default localhost:5341)

# Author

    # Maintainers

      Last Updated: 11/29/2020, 11:57:37 AM

      Other topics