diff --git a/bitbake/lib/toaster/toastermain/logs.py b/bitbake/lib/toaster/toastermain/logs.py
index db5d459f9b..573fbef9e5 100644
--- a/bitbake/lib/toaster/toastermain/logs.py
+++ b/bitbake/lib/toaster/toastermain/logs.py
@@ -8,7 +8,7 @@ from pathlib import Path
 from django.http import HttpRequest
 
 #BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
-BUILDDIR = os.environ.get("BUILDDIR")
+BUILDDIR = Path(os.environ.get('BUILDDIR'))
 
 
 def log_api_request(request, response, view, logger_name='api'):
