Closed superman20 closed 7 years ago
In the section of code you show, I agree that stripping the newlines would improve readability. However, I suspect that there are other areas where LOGPROTOCOL lines are quite a bit longer and the opposite is true.
I rarely use LOGPROTOCOL but if I did and wanted to change the defaults, I'd consider a survey of PROTOCOL level logs to be analyzed with a healthy selection of plugins enabled. Compare before and after. I suspect an optimal solution would be stripping newlines of lines < N chars and leaving the default behavior for lines longer than N chars.
I find myself looking at protocol level logs often enough for various reasons and so I only ask the question to see if people don't care or really want it left in. My personal preference is to always remove them no matter the length. When viewing the logs, I can let the text viewer handle excessive line length wrapping for me if I want it. I currently have my own logging plugin that creates daily rotating logs (since no built-in syslog option on Windows) and so I can easily remove them there...but if no one really must have them, it would be more efficient to remove them at the logger.js level. I'll also say that the only plugins I currently use that emit protocol level info is clamd and spamassassin.
If others are interested in removing them or implementing something more like @msimerson suggests, then I'll submit a PR.
Feel free to close this topic whenever you feel like it has outlived its usefulness.
Yeah I'd say submit the PR anyway. I don't know why it's like that off hand.
On Thu, May 25, 2017 at 1:46 PM, superman20 notifications@github.com wrote:
I find myself looking at protocol level logs often enough for various reasons and so I only ask the question to see if people don't care or really want it left in. My personal preference is to always remove them no matter the length. When viewing the logs, I can let the text viewer handle excessive line length wrapping for me if I want it. I currently have my own logging plugin that creates daily rotating logs (since no built-in syslog option on Windows) and so I can easily remove them there...but if no one really must have them, it would be more efficient to remove them at the logger.js level. I'll also say that the only plugins I currently use that emit protocol level info is clamd and spamassassin.
If others are interested in removing them or implementing something more like @msimerson https://github.com/msimerson suggests, then I'll submit a PR.
Feel free to close this topic whenever you feel like it has outlived its usefulness.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haraka/Haraka/issues/1946#issuecomment-304075275, or mute the thread https://github.com/notifications/unsubscribe-auth/AAobY0pi2guEsdmKiVkS9sqka-F2I40Zks5r9b5jgaJpZM4NmU3L .
Starting on line 80 of logger.js we see:
Is there a reason why the actual line-feed character is kept in the output? This makes some of the protocol log entries wrap to the next line. It seems like this would be generally unfavorable...but I assume there is some other reason I haven't thought of to keep it?
For an example, SpamAssassin output looks like this since the \n is retained:
In my opinion, having the complete log entry on 1 line makes the logs easier to read.