All notable changes to this project will be documented in this file.
- Support for nodejs v23
- Update deps
- feat: use toJSON method from axios instance
- fix: ensure delete logs files for 0 days
- fix: update deps
- fix: ensure
publishmethod create all index on unique command. - fix: ensure on
publishdo not replace steps on existing log,
- fix: ensure reset
createdAtattribute for a new date on clearGlobalLog
- feat: added ttl option to expire log
- feat: added ignore empty step on publish
- feat: added clear step after publish
log.publish(
Config.Mongo({
url: 'mongodb://mongo:mongo@localhost:27017',
clearAfterPublish: true,
expireAfterDays: 7, // default 30 days
ignoreEmpty: true
})
);- fix: added mongo config type to autoPublish middleware
- feat: added support to mongodb provider
- added global log as singleton
- added category atribute to step
- added mask option to stackLog middleware
import { GlobalLog } from 'ts-logs';
const global = GlobalLog.singleton();
// ...
// remember clear steps after publish or write local
global.clear();The operation is updateOne with upsert=true based on log.uid and log.name.
If already exists some log them update else insert
await log.publish(Config.Mongo({ url: 'mongodb://localhost:27017' }));Based on your business rule Its possible define a category to a step
Step.info({ name: 'some', message: 'info', category: 'financial' });The middleware stackLog accept mask config
stackLog({
writeLocal: true,
mask: [ { key: 'password' } ]
})- feat: added
deleteExpiredFilemethod to remove expired files from local log folder.
- fix: update mask regex to replace any char instead only alphanumeric one
- doc: added README.md as doc file
- step: feat added
maskmethod to step instance. Now Its possible to hidden values with * char.
- step: feat added support to data as object
- fix: fix
GetFileNameto add 0 when day number is less than 10. - fix: fix
getStepDataFromRequestto ignore tag keys when body data is array. - fix: ensure get tags from data as attribute key if do not provide tag value.
- fix: ensure encrypt and decrypt sub object key
- feat: added "encrypt" function to step.
- fix: use "index" as default when stackLog from main route.
- fix: changing any log state if it is set as "stateful" stateType.
- feat: added "additionalInfo" attribute to step.
- change: rename attribute "addBehavior" to "stateType" on log.
- feat: added
removemethod to remove keys from body on step instance
- fix: ensure get id from body if exists and apply to step instance
- feat: added
autoPublishLogmiddleware
- feat: added provider to publish to aws S3
- feat: added provider to publish to an endpoint by http request.
- fix: get caller class name from error.
- fix: get tags from catch error and format data on error.
- added: implement
Step.catch(err)to create a step from Error.
- fix: write local file
- fix: remove keys from sub object in body or data using
remove: []option
- added: implement
bindLogto bind a log instance to request.
- fix: added step on write local log
- fix: change step from
infotostack
- rename: from
LOGMiddlewaretostackLog
- log: change generated file name to .log
- log: added middleware builder
- log: added "method" attribute to step as "GET", "POST" ... option
- log: format messages for each category
- [ UNDEF ]: When create step with invalid type
- [ LOG ]: When create a global log - Log.ini()
- log: remove console.log and use process.stdout
- log: added global log
- log: added step log
- log: added print function
- log: added save local log on txt file
- log: create base lib