ruffrey/mailsac

How can i add the requester IP address to logs?

fmrosa opened this issue · 3 comments

There is a way to log the requester IP address to mailsac.log?

During an HTTP request to the UI, or during SMTP stuff?

The HTTP request. I just wanted to keep IP logs of people who accessed the UI for auditing in case something goes wrong or bad.

It is a standard express app using morgan for logging.

The middleware in mailsac is here:
https://github.com/ruffrey/mailsac/blob/master/app.js#L112

morgan logger formatting docs:
https://github.com/expressjs/morgan#predefined-formats