Comments (5)
Debug statements are most useful when debugging, obviously- those particular statements have been useful in catching mistakes and identifying issues I didn't know where around. Perhaps its time to add some configurable granularity to debug logs?
from lua-resty-waf.
Yes and no, its debug logs so they can be a bit verbose. Granularity might be an overkill. Personally I just think logging inside utility functions i.e the _table_
functions to be redundant. These functions should instead be rigorously tested. Application specific logging can then occur outside if necessary.
This also allows for these utility functions to be used in the module context where options are unavailable. I found I needed to do this in my branch a few times (e.g _table_clone
on the default options)
from lua-resty-waf.
I agree with splitice. Some logging is unnecessary, and I think _log should supply for log level directly, as for the logging content, we should write it before thinking about seriously.
from lua-resty-waf.
"Personally I just think logging inside utility functions i.e the table functions to be redundant. These functions should instead be rigorously tested. Application specific logging can then occur outside if necessary."
Yep, the more I look at this, this more I agree. Once I finish breaking out lookup tables and various functions into smaller libraries, we can start unit testing with something like Test::Nginx::Socket::Lua, and the nasty debug logs can go away.
from lua-resty-waf.
More work done on this in:
If there are suggestions on cleaning this further, feel free to submit a PR :)
from lua-resty-waf.
Related Issues (20)
- Modsecurity response rules not working! - response body won't process! HOT 19
- How can I handle log by myself? HOT 2
- API protection HOT 1
- how to use lua-resty-waf HOT 2
- ISO 8601 timestamp format HOT 1
- Error in using modsec2lua-resty-waf.pl HOT 2
- Load_secrules doesn't effect. HOT 13
- RESPONSE-95xx.conf doesn't work HOT 3
- which is better performance in lua_resty_waf.load_secrules or add_ruleset HOT 1
- compile error with gcc7 HOT 1
- why parse request_uri ourselfs?
- Logging not working in lua-resty-waf HOT 1
- events logs not being captured & help in activating additonal ruleset HOT 1
- runtime error attempt to index local 'self' (a nil value) HOT 2
- Translation errors with OWASP CRSv3 rules
- create error page
- no HOT 1
- It works not good as I expected
- Possibility to match on two criteria
- ‘attempt to call a nil value’ error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-resty-waf.