Skip to content

Set log output to /var/log/vulnerablecode #1693 #1786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions vulnerablecode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# See https://aboutcode.org for more information about nexB OSS projects.
#

import os
import sys
from pathlib import Path

Expand Down Expand Up @@ -322,6 +323,8 @@
"127.0.0.1",
]

LOG_DIR = env.str("VULNERABLECODE_LOG_DIR", "/var/log/vulnerablecode")
os.makedirs(LOG_DIR, exist_ok=True)

LOGGING = {
"version": 1,
Expand All @@ -340,6 +343,13 @@
"class": "logging.StreamHandler",
"formatter": "simple",
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": os.path.join(LOG_DIR, "vulnerablecode.log"),
"formatter": "simple",
"maxBytes": 10485760,
"backupCount": 5,
},
},
"loggers": {
"vulnerabilities.pipelines": {
Expand Down