You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to filter-out certain LogEvents based on the content (the log message itself), something that is not possible with typical filtering (which is usually limited at levels & categories).
Unfortunately, when I return "", I still get an empty line in the console (which makes sense, since log4js prints whatever the log function returns. But I'm wondering if there's a way to tell log4js to hide a message completely.
Ideally, either when I return "null" or empty string, I would like it to not display anything. Most likely "null" would be a better candidate for this.
But can't figure out exactly where custom layouts are implemented.
The text was updated successfully, but these errors were encountered:
mihaibrana
changed the title
How to make the custom log4js layout function to hide certain log messages?
Hide certain log messages that pass through custom layout function
Dec 8, 2020
I would also be interested in knowing this. I'd like to filter based on user-agent. While debugging on production, the log entries from the crawlers are interfering.
Hello :). Thank you for porting & creating this library. Excellent work, that has helped me a great deal :).
I'm using my own layout for an appender.
https://github.com/log4js-node/log4js-node/blob/master/docs/layouts.md
I'd like to filter-out certain LogEvents based on the content (the log message itself), something that is not possible with typical filtering (which is usually limited at levels & categories).
Unfortunately, when I
return ""
, I still get an empty line in the console (which makes sense, since log4js prints whatever the log function returns. But I'm wondering if there's a way to tell log4js to hide a message completely.Ideally, either when I return "null" or empty string, I would like it to not display anything. Most likely "null" would be a better candidate for this.
I've taken a (short!) look in:
https://github.com/log4js-node/log4js-node/blob/master/lib/layouts.js
But can't figure out exactly where custom layouts are implemented.
The text was updated successfully, but these errors were encountered: