req_id
is now an unique string, the originalreq_id
has renamed toreq-seq
.host
is renamed toserver_ip
.hostname
is renamed todomain
.
- Add
server_host
field. - Add
genId
function parameter to generate custom log id.
- Remove
kafkaSchedule
mongooseModel
alarm
option, please useonReqFinished
instead. - The default
dataFormat
function will use JSON.stringify to return string, since it's safe for elasticsearch. If you want to return with you own format, please pass thedataFormat
parameter yourself. - You should use
const requestLog = require('@yunnysunny/request-logging').default;
to access the default middleware function in cjs module.
- Add support for esm module.
- Add
router
field.
- Fix log not recorded on node 16+ when client close the http underlay socket. see issue 40775 on node also.
- Fix document url.
- Add
stdoutDisabled
parameter to middleware.
- Add express.Request parameter to FormatFunction.
- Add support for typescript.
- Remove the default value of response data. You should avoid reading undefined object in
dataFormat
function when format response data.
- Add the field of
res_data
, which contains the reponse data.
- Fix the issue of #2
- Add the field of
aborted
to indicate whether the request is aborted.
- Add the parameter of
dataFormat
to resolve the conflict occured in elasticsearch.
- Add the key of
content_length_req
to indicate the length of the request.
- Add the parameter of
customHeaderKeys
, which indicate the specific headers to store into mongo and kafka.
- Add the key of
req_time_string
, formated in ISO 8601 Extended Format.
- Bump node-slogger to 2.0.0 .
- Fix the value of
host
, see the issue #1.
- Add the key of
hostname
to indicate the domain of current server.
- Fix the lack of the right semicolon of user agent string.
- Remove unnecessary message of alarm.
- Don't send alarm message when status code is greater than 600.
- In some condition, the event of
finish
will not trigger, so I overwrite theend
function ofres
to fix it.
- Add the field
res-code
.
- Saving request logging to mongodb.
- Add the filed
req_id
.
- Fixed the issue of broken when not given the default parameter.
- Fixed the code error in
readme.md
.
- Project init.