Giter Site home page Giter Site logo

lupu60 / nestjs-toolbox Goto Github PK

View Code? Open in Web Editor NEW
279.0 279.0 10.0 4.71 MB

The repository contains a suite of components and modules for Nest.js

Home Page: https://lupu60.github.io/nestjs-toolbox/

License: MIT License

TypeScript 94.44% JavaScript 5.56%
acl logger nest nestjs nestjs-toolbox open-api typescript

nestjs-toolbox's Introduction

@lupu60's Holopin board

{
  "name": "Bogdan Lupu",
  "skills":["typescript","express","nestjs","SQL"]
}

nestjs-toolbox's People

Contributors

allcontributors[bot] avatar dependabot-preview[bot] avatar dependabot[bot] avatar getlarge avatar lupu60 avatar snyk-bot avatar zieglar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nestjs-toolbox's Issues

how to custom timestamp?

  • I'm submitting a ...
    [ ] bug report
    [x] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    need reformat timestamp in log output

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Which are updated or inserted

Is your feature request related to a problem? Please describe.
When performing upsert I would like to know which entity that updated or inserted.

Describe the solution you'd like
return the status (inserted or updated)

Limit max log string length

Is your feature request related to a problem? Please describe.
Is there a way to simply limit the size of the logged message ?

Describe the solution you'd like
Providing an option like maxLength, that would handle string slicing.

Issue with structured logging - Seq

Describe the bug
When using Seq logging (I am using the package bunyan-seq to create a custom stream) The string interpolation / variable substitution does not work

To Reproduce
Steps to reproduce the behavior:

  1. Include bunyan-seq package to your project along with @nest-toolbox/bunyan-logger
  2. Setup the logging service as mentioned below in the main.ts
  3. In the controller's create an instance of Logger from @nestjs/common
  4. call the logger methods as described below and see the results

Expected behavior
When logging with the following statement:
this.logger.warn('{user} tried access the {service} service with an expired key!',{ user: 'E73882', service: 'PurchaseOrder'});
the output in the log should be
E73882 tried access the PurchaseOrder service with an expired key!

image

Screenshots
What happens is:

image

Additional context
Here is my main.ts:

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

const seq = require('bunyan-seq');

async function bootstrap() {
  const app = await NestFactory.create(AppModule,{
    bufferLogs: true,
  });

  app.useLogger(new BunyanLoggerService({      
        projectId: 'NestJS-Microservice',
        formatterOptions: {
          outputMode: 'json',
        },
        customStreams:[seq.createStream({serverUrl: 'http://localhost:5341', apiKey: '123456789'})]  ,
        extraFields: {
          app: 'extra-field-app',
          sample: 'extra-field-sample'
        }    
    }));

  await app.listen(3000);
}
bootstrap();`


In the controller in just create a Logger instance as follows and uses it:


`private readonly logger = new Logger('AppController');`

Examples:
 `this.logger.warn('English hello {lang}',{ lang: 'en' });    `

Not updating updatedAt

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create entity with updatedAt column using TypeOrm:
@UpdateDateColumn()
public updatedAt!: Date;
  1. Do an upsert with one element await TypeOrmUpsert.upsert(English, [{ path: 'foo', phrase: 'hi'}], 'path');

Expected behavior
The "updatedAt" column should update.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: All (Firefox latest, Chrome latest, Safari latest)
  • Version: "@nest-toolbox/typeorm-upsert": "^1.4.2",

Smartphone (please complete the following information):
not applicable

Additional context
not applicable

Support node 12

Right now only node 14 is supported. Can Node 12 be used in addition?

yarn
...
error @nest-toolbox/[email protected]: The engine "node" is incompatible with this module. Expected version "14". Got "12.22.3"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.