winstonjs / winston-daily-rotate-file

A transport for winston which logs to a rotating file each day.
MIT License
899 stars 156 forks source link

Access IP Address of the user. #356

Closed vivek-settlemint closed 2 years ago

vivek-settlemint commented 2 years ago

Is there any option to access current IP address or request object of the user?

wbt commented 2 years ago

Yes. It depends what server you're using to process the request, but you can get whatever attributes are available in your execution context and send them to logging as components of a log object or message. This is not really specific to Winston as a logging library, so I'm closing this here and recommend making a well-formed question for Stack Overflow if you still have questions.