summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastermain/logs.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastermain/logs.py')
-rw-r--r--bitbake/lib/toaster/toastermain/logs.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastermain/logs.py b/bitbake/lib/toaster/toastermain/logs.py
index b4910e4432..62d871963a 100644
--- a/bitbake/lib/toaster/toastermain/logs.py
+++ b/bitbake/lib/toaster/toastermain/logs.py
@@ -1,13 +1,13 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2# -*- coding: utf-8 -*- 2# -*- coding: utf-8 -*-
3 3
4import os
4import logging 5import logging
5import json 6import json
6from pathlib import Path 7from pathlib import Path
7from django.http import HttpRequest 8from django.http import HttpRequest
8 9
9BASE_DIR = Path(__file__).resolve(strict=True).parent.parent 10BUILDDIR = Path(os.environ.get('BUILDDIR', '/tmp'))
10
11 11
12def log_api_request(request, response, view, logger_name='api'): 12def log_api_request(request, response, view, logger_name='api'):
13 """Helper function for LogAPIMixin""" 13 """Helper function for LogAPIMixin"""
@@ -108,7 +108,7 @@ LOGGING_SETTINGS = {
108 'file_django': { 108 'file_django': {
109 'level': 'INFO', 109 'level': 'INFO',
110 'class': 'logging.handlers.TimedRotatingFileHandler', 110 'class': 'logging.handlers.TimedRotatingFileHandler',
111 'filename': BASE_DIR / 'logs/django.log', 111 'filename': BUILDDIR / 'toaster_logs/django.log',
112 'when': 'D', # interval type 112 'when': 'D', # interval type
113 'interval': 1, # defaults to 1 113 'interval': 1, # defaults to 1
114 'backupCount': 10, # how many files to keep 114 'backupCount': 10, # how many files to keep
@@ -117,7 +117,7 @@ LOGGING_SETTINGS = {
117 'file_api': { 117 'file_api': {
118 'level': 'INFO', 118 'level': 'INFO',
119 'class': 'logging.handlers.TimedRotatingFileHandler', 119 'class': 'logging.handlers.TimedRotatingFileHandler',
120 'filename': BASE_DIR / 'logs/api.log', 120 'filename': BUILDDIR / 'toaster_logs/api.log',
121 'when': 'D', 121 'when': 'D',
122 'interval': 1, 122 'interval': 1,
123 'backupCount': 10, 123 'backupCount': 10,
@@ -126,7 +126,7 @@ LOGGING_SETTINGS = {
126 'file_toaster': { 126 'file_toaster': {
127 'level': 'INFO', 127 'level': 'INFO',
128 'class': 'logging.handlers.TimedRotatingFileHandler', 128 'class': 'logging.handlers.TimedRotatingFileHandler',
129 'filename': BASE_DIR / 'logs/toaster.log', 129 'filename': BUILDDIR / 'toaster_logs/web.log',
130 'when': 'D', 130 'when': 'D',
131 'interval': 1, 131 'interval': 1,
132 'backupCount': 10, 132 'backupCount': 10,