Skip to content

Commit 943715b

Browse files
committed
fix logging
1 parent 18fba09 commit 943715b

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

deploy_prod.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ if [ -f ${PID_FILE} ]; then
4141
while pgrep -u pk gunicorn > /dev/null && [ $timeout -lt 30 ]; do
4242
sleep 1
4343
timeout=$((timeout+1))
44+
echo "Waiting $timeout seconds"
4445
done
4546
fi
4647

pythonkr_backend/pythonkr_backend/settings/base.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from pathlib import Path
1414
import os
1515

16+
1617
# Build paths inside the project like this: BASE_DIR / 'subdir'.
1718
BASE_DIR = Path(__file__).resolve().parent.parent.parent
1819

@@ -186,6 +187,22 @@
186187
"0.0.0.0",
187188
]
188189

190+
# LOGGING
191+
192+
LOGGING = {
193+
"version": 1,
194+
"disable_existing_loggers": False,
195+
"handlers": {
196+
"console": {
197+
"class": "logging.StreamHandler",
198+
},
199+
},
200+
"root": {
201+
"handlers": ["console"],
202+
"level": "INFO",
203+
},
204+
}
205+
189206
# import logfire
190207
# setup logfire
191208
#logfire.configure(environment='base', service_name="web")

pythonkr_backend/pythonkr_backend/settings/prod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
BUILD_DIR = os.path.join("/home/pk/bakery_static", "build")
2929

3030

31-
logger = logging.getLogger(__name__)
31+
logger = logging.getLogger('root')
3232

3333
# service_version
3434
sha_service_version = os.environ.get("SHA")

0 commit comments

Comments
 (0)