mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
wip: granian logging
This commit is contained in:
parent
b987d807d4
commit
a58e98c4b1
@ -5,7 +5,7 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
- .secrets
|
- .secrets
|
||||||
command: granian --interface asgi --host 0.0.0.0 --port 8080 --loop uvloop app.main:app
|
command: granian --interface asgi --host 0.0.0.0 --port 8080 --loop uvloop app.main:app --log-level debug
|
||||||
volumes:
|
volumes:
|
||||||
- .:/home/code
|
- .:/home/code
|
||||||
ports:
|
ports:
|
||||||
|
55
logging-config.json
Normal file
55
logging-config.json
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"disable_existing_loggers": false,
|
||||||
|
"formatters": {
|
||||||
|
"default": {
|
||||||
|
"format": "[%(process)d|%(name)-12s] %(message)s",
|
||||||
|
"class": "logging.Formatter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"handlers": {
|
||||||
|
"console": {
|
||||||
|
"class": "app.utils.logging.RichConsoleHandler",
|
||||||
|
"level": "DEBUG",
|
||||||
|
"formatter": "default",
|
||||||
|
"stream": "ext://sys.stdout",
|
||||||
|
"kwargs": {"omit_repeated_times": "True", "show_time": "False", "enable_link_path": "False", "tracebacks_show_locals": "True", "rich_tracebacks": "True"},
|
||||||
|
"args": "(100, 'white')"
|
||||||
|
|
||||||
|
},
|
||||||
|
"sqlalchemy": {
|
||||||
|
// "class": "logging.handlers.TimedRotatingFileHandler",
|
||||||
|
// "level": "DEBUG",
|
||||||
|
// "formatter": "verbose",
|
||||||
|
// "when": "D",
|
||||||
|
// "backupCount": 0,
|
||||||
|
// "filename": "./logs/training-stats.log"
|
||||||
|
},
|
||||||
|
"granian": {
|
||||||
|
// "class": "logging.handlers.TimedRotatingFileHandler",
|
||||||
|
// "level": "DEBUG",
|
||||||
|
// "formatter": "verbose",
|
||||||
|
// "when": "D",
|
||||||
|
// "backupCount": 0,
|
||||||
|
// "filename": "./logs/uvicorn.log"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"loggers": {
|
||||||
|
"root": {
|
||||||
|
// "level": "DEBUG",
|
||||||
|
// "handlers": ["console"]
|
||||||
|
},
|
||||||
|
"sqlalchemy.engine.Engine": {
|
||||||
|
// "level": "DEBUG",
|
||||||
|
// "handlers": ["file"],
|
||||||
|
// "propagate": true,
|
||||||
|
// "qualname": "app"
|
||||||
|
},
|
||||||
|
"granian.access": {
|
||||||
|
// "level": "DEBUG",
|
||||||
|
// "handlers": ["uvicorn"],
|
||||||
|
// "propagate": true,
|
||||||
|
// "qualname": "uvicorn"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user