summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastermain/settings.py
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-10-27 01:36:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-27 08:32:29 +0100
commit7e0cce4f6b754e33a0652b516d622b6b40b3abd7 (patch)
tree70c1a56a25d68a77aa17f429085007c127f08aba /bitbake/lib/toaster/toastermain/settings.py
parent6c43e8403203805fa23171be80deb7717def034a (diff)
downloadpoky-7e0cce4f6b754e33a0652b516d622b6b40b3abd7.tar.gz
bitbake: toaster: Write logs to BUILDDIR/toaster_logs
Fixes "2efb14648 toaster: Monitoring - implement Django logging system" when running in a container. When running in a container, the previous approach of using BASE_DIR is not a writable path. Also, we really do not want to be writing logs into the source tree, as the BASE_DIR was resolving to bitbake/lib/toaster/logs Since Toaster is only ever running in an environment where oe-init-buildenv or similar has been sourced, we should instead write the logs to BUILDDIR. Using BUILDDIR to logs make path writable but django-log-viewer does'nt manage to write logs using an absolute path as BUILDDIR, where the existing toaster_ui.log was already being written. Also drop the /logs/ directory, as it has not been created which also breaks in a container environment To handle the constraints linked to django-log-viewer and /logs/, we've updated bitbake/bin/toaster to create a toaster_logs/ directory in BUILDDIR if it doesn't exist, when toaster starts up. Also manage to set BUILDDIR/toaster_logs/ as default location for toaster logs. (Bitbake rev: efbd9d54f57be7a7a10f0b56e7e62c25974e99e6) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Tim Orling <tim.orling@konsulko.com> Tested-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastermain/settings.py')
-rw-r--r--bitbake/lib/toaster/toastermain/settings.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py
index b083cf5885..5de881c4bb 100644
--- a/bitbake/lib/toaster/toastermain/settings.py
+++ b/bitbake/lib/toaster/toastermain/settings.py
@@ -316,12 +316,12 @@ for t in os.walk(os.path.dirname(currentdir)):
316LOGGING = LOGGING_SETTINGS 316LOGGING = LOGGING_SETTINGS
317 317
318# Build paths inside the project like this: BASE_DIR / 'subdir'. 318# Build paths inside the project like this: BASE_DIR / 'subdir'.
319BASE_DIR = Path(__file__).resolve(strict=True).parent.parent 319BUILDDIR = os.environ.get("BUILDDIR", "/tmp")
320 320
321# LOG VIEWER 321# LOG VIEWER
322# https://pypi.org/project/django-log-viewer/ 322# https://pypi.org/project/django-log-viewer/
323LOG_VIEWER_FILES_PATTERN = '*.log*' 323LOG_VIEWER_FILES_PATTERN = '*.log*'
324LOG_VIEWER_FILES_DIR = os.path.join(BASE_DIR, 'logs') 324LOG_VIEWER_FILES_DIR = os.path.join(BUILDDIR, "toaster_logs/")
325LOG_VIEWER_PAGE_LENGTH = 25 # total log lines per-page 325LOG_VIEWER_PAGE_LENGTH = 25 # total log lines per-page
326LOG_VIEWER_MAX_READ_LINES = 100000 # total log lines will be read 326LOG_VIEWER_MAX_READ_LINES = 100000 # total log lines will be read
327LOG_VIEWER_PATTERNS = ['INFO', 'DEBUG', 'WARNING', 'ERROR', 'CRITICAL'] 327LOG_VIEWER_PATTERNS = ['INFO', 'DEBUG', 'WARNING', 'ERROR', 'CRITICAL']