mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
User ID logging even on exceptions, more detailed feedback logging/saving, stuff module fix, login screen description on feedback change
This commit is contained in:
parent
d590574712
commit
658840bd84
5 changed files with 22 additions and 14 deletions
|
@ -358,12 +358,20 @@ function GetApp () {
|
|||
|
||||
app.post('/postfeedback', function (req, res) {
|
||||
logger.LogReq(req)
|
||||
if (res.body.fromLogin) {
|
||||
if (req.body.fromLogin) {
|
||||
logger.Log('New feedback message from Login page', logger.GetColor('bluebg'), true)
|
||||
} else {
|
||||
logger.Log('New feedback message from feedback page', logger.GetColor('bluebg'), true)
|
||||
}
|
||||
utils.AppendToFile(utils.GetDateString() + ':\n' + JSON.stringify(req.body), msgFile)
|
||||
|
||||
const ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
||||
const user = req.session.user
|
||||
|
||||
utils.AppendToFile(utils.GetDateString() + ':\n' + JSON.stringify({
|
||||
...req.body,
|
||||
userID: user ? user.id : 'no user',
|
||||
ip: ip
|
||||
}), msgFile)
|
||||
res.json({ success: true })
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue