|
1 | 1 | # fastapi-gae-logging
|
2 |
| -Custom Cloud Logging handler for FastAPI applications deployed in Google App Engine to ease out logs analysis and monitoring through Google Cloud Log Explorer. |
| 2 | +Custom Cloud Logging handler for FastAPI (or any Starlette based) applications deployed in Google App Engine to ease out logs analysis and monitoring through Google Cloud Log Explorer. |
3 | 3 |
|
4 | 4 | ## What problem does this package solve? Why do we need this?
|
5 | 5 | When deploying FastAPI applications on Google App Engine, I encountered several challenges with logging and observability even when using the official package for this purpose, `google-cloud-logging`.
|
@@ -41,15 +41,15 @@ The `fastapi-gae-logging` module addresses these problems by:
|
41 | 41 |
|
42 | 42 | ```python
|
43 | 43 | FastAPIGAELoggingHandler(
|
44 |
| - app: FastAPI, |
| 44 | + app: Starlette, |
45 | 45 | request_logger_name: Optional[str] = None,
|
46 | 46 | log_payload: bool = True,
|
47 | 47 | *args, **kwargs
|
48 | 48 | )
|
49 | 49 | ```
|
50 | 50 |
|
51 | 51 | - Parameters
|
52 |
| - - **app** (FastAPI): The FastAPI application instance. |
| 52 | + - **app** (FastAPI | Starlette): The FastAPI or Starlette application instance. |
53 | 53 | - **request_logger_name** (Optional[str], optional): The name of the Cloud Logging logger to use for request logs.
|
54 | 54 | Defaults to the Google Cloud Project ID with the suffix '-request-logger'.
|
55 | 55 |
|
@@ -150,7 +150,7 @@ def post_payload(payload: Any = Body(None)):
|
150 | 150 | ## Dependencies
|
151 | 151 | This tool is built upon the following packages:
|
152 | 152 |
|
153 |
| -- `fastapi`: A modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints. |
| 153 | +- `starlette`: A modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints. |
154 | 154 | - `google-cloud-logging`: Google Cloud Logging API client library for logging and managing logs in Google Cloud Platform.
|
155 | 155 |
|
156 | 156 |
|
|
0 commit comments