1e765f4b2b
Stop werkzeug request spam into PM2 error files, truncate oversized logs, and install daily logrotate with 3-day retention. Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
466 B
Python
18 lines
466 B
Python
"""silence_werkzeug_access_log 烟雾测试."""
|
|
import logging
|
|
import unittest
|
|
|
|
from lib.common.flask_access_log_lib import silence_werkzeug_access_log
|
|
|
|
|
|
class TestSilenceAccessLog(unittest.TestCase):
|
|
def test_sets_warning_level(self):
|
|
log = logging.getLogger("werkzeug")
|
|
log.setLevel(logging.INFO)
|
|
silence_werkzeug_access_log()
|
|
self.assertGreaterEqual(log.level, logging.WARNING)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|