
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
safetrack-log
Advanced tools
Stores the logs of the requests and responses to the APIs
Stores the logs of the requests and responses to the APIs
requestTime: request time
url: endpoint service
username: username request
roles: user roles
responseStatus: response status (200 | 400 | 500 etc)
verb: method (POST | GET | PUT | DETELE)
requestHeader: request header
requestBody: request body
responseBody: response body
requestIp: request ip
requestSsoo: user agent
Install with npm:
$ npm i safetrack-log
Project name
name
is returnedConfigura conexión
#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
{root-project}/deploy.yaml
...
spec:
containers:
- name: safetrack-business-instance-qs
image: {{image}}
env:
...
- name: TYPEORM_TYPE_LOG
valueFrom:
secretKeyRef:
name: safetrack-backend-secret
key: typeorm_type_log
- name: TYPEORM_HOST_LOG
valueFrom:
secretKeyRef:
name: safetrack-backend-secret
key: typeorm_host_log
- name: TYPEORM_USERNAME_LOG
valueFrom:
secretKeyRef:
name: safetrack-backend-secret
key: typeorm_username_log
- name: TYPEORM_PASSWORD_LOG
valueFrom:
secretKeyRef:
name: safetrack-backend-secret
key: typeorm_password_log
- name: TYPEORM_DATABASE_LOG
valueFrom:
secretKeyRef:
name: safetrack-backend-secret
key: typeorm_database_log
- name: TYPEORM_PORT_LOG
valueFrom:
secretKeyRef:
name: safetrack-backend-secret
key: typeorm_port_log
- name: TYPEORM_SYNCHRONIZE_LOG
valueFrom:
secretKeyRef:
name: safetrack-backend-secret
key: typeorm_synchronize_log
- name: TYPEORM_LOGGING_LOG
valueFrom:
secretKeyRef:
name: safetrack-backend-secret
key: typeorm_logging_log
{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
LoggerMiddlware
, modify file {root-project}/src/middlewares/index.ts
...
import { LoggerMiddleware } from 'safetrack-log';
export const middlewares = [
...
LoggerMiddleware
];
FAQs
Stores the logs of the requests and responses to the APIs
The npm package safetrack-log receives a total of 0 weekly downloads. As such, safetrack-log popularity was classified as not popular.
We found that safetrack-log demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.