Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tnunamak committed Mar 20, 2024
1 parent 9683cef commit dafb7bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Binary file modified selfie-ui/src/app/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions selfie-ui/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import React from 'react'
import { Providers } from './providers'

export const metadata: Metadata = {
title: 'Home',
description: 'Welcome to Selfie',
title: 'Selfie',
description: 'Welcome to Selfie',
}

export default function Layout({ children }: { children: React.ReactNode }) {
Expand Down
11 changes: 9 additions & 2 deletions selfie/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def start_fastapi_server():
}

uvicorn_log_config["formatters"]["default"] = {
"class": "uvicorn.logging.DefaultFormatter",
"fmt": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
"use_colors": False,
}

Expand All @@ -126,11 +126,18 @@ def start_fastapi_server():
"propagate": False,
}

uvicorn_log_config["loggers"]["uvicorn.*"] = {
uvicorn_log_config["loggers"]["uvicorn.error"] = {
"handlers": ["selfie", "console"],
"level": "INFO",
"propagate": False,
}

uvicorn_log_config["loggers"]["uvicorn.access"] = {
"handlers": ["selfie", "console"],
"level": "INFO",
"propagate": False,
"formatter": "access",
}
# Start Uvicorn with the modified log config
uvicorn.run(fastapi_app, host="0.0.0.0", port=args.port, log_config=uvicorn_log_config)

Expand Down

0 comments on commit dafb7bf

Please sign in to comment.