@samet-it/be-log-common
v1.0.2
Published
Back End: Log Common
Readme
Samet IT : Log Common
ts backend component
__
/ ____ ____ _ _________ ____ ___ ____ ___ ____ ____
/ / __ \/ __ `/ / ___/ __ \/ __ `__ \/ __ `__ \/ __ \/ __ \
/ / /_/ / /_/ / / /__/ /_/ / / / / / / / / / / / /_/ / / / /
/_/\____/\__, / \___/\____/_/ /_/ /_/_/ /_/ /_/\____/_/ /_/
/____/ EN: It attaches daily log file generator for NestTR: Nest'e günlük logu tutması için log bağlar
Prerequisite
- Help
- 1 - Install Git
- 2 - Build Up a Git Connection
- 3 - Install Node/NPM
- 4 - Create Project Folder
- 5 - Bind Projects Folder to Git
Usage
EN: If you want to store daily log file ...TR: Eğer günlük tutmak istiyorsan ...
# install the component
npm i @samet-it/be-log-common// - go to service.ts file
// - import the instance on top
import {commonLogger} from '@samet-it/be-log-common';// - go to start() method
// - add the line below, while app has been enriching various settings before app.listen
app.useLogger(commonLogger.buildDailyFile());Environments
| Name | Type | Default | Required | Secret | Description |
|----------------------|---------|-----------------------|----------|--------|----------------------------|
| LOG_FILE_PATTERN | string | logs/log-%DATE%.log | | | Daily log file pattern |
| LOG_DATE_PATTERN | string | DDMMYYYY | | | Date pattern for log |
| LOG_ZIPPED_ARCHIVE | boolean | false | | | Zipped file or raw file |
| LOG_FILE_SIZE | string | 20m | | | Log file size |
| LOG_JSON_FORMAT | boolean | false | | | Json format or line format |
Contents
- logCommonConfig - config
- commonLogger - Attach instance to Nestjs
- winstonLoggerOptions - Adapter for winston/nestjs
Development
You can start to develop on it
Step 1
Step 2
EN: Clone the projectTR: Projeyi bilgisayarına çek
git clone https://github.com/samet-digital/be-log-common.git -b developmentDependencies
@samet-it/be-base-common: samet base common@leyyo/*: leyyo utilities@nestjs/common: nestjs frameworkwinston: winston loggerwinston-daily-rotate-file: winston file rotatornest-winston: winston vs nestjs adapter
Commands
Standards
+ language: TS
+ lint: eslint
+ inspections: intelli-j code inspections
+ ddd: domain driven development
+ edd: exception driven development
! tdd: test driven development
+ ldd: log driven development
+ ddd: document driven developmentHistory
| Date | Developer | Info | Ticket | |------------|----------------|--------------|----------------| | 2025-08-07 | Seyit Bacil | Created | ~~none~~ | | 2025-08-12 | Mustafa Yelmer | Refactored | ~~none~~ | | 2025-08-14 | Mustafa Yelmer | Documented | ~~none~~ | | 2026-01-03 | Mustafa Yelmer | Refactored | ~~none~~ |
