New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

safetrack-log

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

safetrack-log

## Install

0.1.5
unpublished
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

safetrack-log NPM version NPM monthly downloads NPM total downloads

Install

Install with npm:

$ npm i safetrack-log

Usage

Project name

  • Check for package.json, if it exists name is returned

Configura conexión

  • Define environment variables
#TYPEORM LOG
TYPEORM_TYPE_LOG = mongodb
TYPEORM_HOST_LOG = localhost
TYPEORM_USERNAME_LOG = safetrack
TYPEORM_PASSWORD_LOG = 
TYPEORM_DATABASE_LOG = safetrack
TYPEORM_PORT_LOG = 27017
TYPEORM_SYNCHRONIZE_LOG = false
TYPEORM_LOGGING_LOG = true
  • Modify file {root-project}/src/database/connection.ts
import { getConnection, Connection, createConnections } from 'typeorm';
import config from '@ormconfig';
import { getConnectionLog } from 'safetrack-log';

const connection = {
  async create(callback?: (c: Connection[]) => void): Promise<void> {
    try {
      const connection = await createConnections([config]);
      connection.push(await getConnectionLog());
      if (callback) {
        callback(connection);
      }
    } catch (error) {
      throw new Error(`ERROR: Creating test db connection: ${error}`);
    }
  },

  async close(): Promise<void> {
    await getConnection().close();
    await getConnection('log').close();
  },
...

Middleware

  • Use middleware LoggerMiddlware, modify file {root-project}/src/middlewares/index.ts
...
import { LoggerMiddleware } from 'safetrack-log';

export const middlewares = [
  ...
  LoggerMiddleware
];

Keywords

Safetrack

FAQs

Package last updated on 29 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts