fastapi-gae-logging 0.0.4__tar.gz → 0.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastapi-gae-logging
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: Custom Cloud Logging handler for FastAPI applications deployed in Google App Engine. Groups logs coming from the same request lifecycle and propagates the maximum log level throughout the request lifecycle using middleware and context management.
5
5
  Home-page: https://github.com/chrisK824/fastapi-gae-logging
6
6
  Author: Chris Karvouniaris
@@ -53,7 +53,27 @@ The `fastapi-gae-logging` module addresses these problems by:
53
53
 
54
54
  ## API
55
55
 
56
- - `FastAPIGAELoggingHandler` class: A custom Cloud Logging Handler for FastAPI applications to use with the official google-cloud-logging library.
56
+ - Initialization
57
+
58
+ ```python
59
+ FastAPIGAELoggingHandler(
60
+ app: FastAPI,
61
+ request_logger_name: Optional[str] = None,
62
+ log_payload: bool = True,
63
+ *args, **kwargs
64
+ )
65
+ ```
66
+
67
+ - Parameters
68
+ - **app** (FastAPI): The FastAPI application instance.
69
+ - **request_logger_name** (Optional[str], optional): The name of the Cloud Logging logger to use for request logs.
70
+ Defaults to the Google Cloud Project ID with the suffix '-request-logger'.
71
+
72
+ - **log_payload** (bool, optional): Whether to log the request payload. If True, the payload for POST, PUT, PATCH, and DELETE requests will be logged. Defaults to True.
73
+
74
+ - ***args**: Additional arguments to pass to the superclass constructor. Any argument you would pass to CloudLoggingHandler.
75
+
76
+ - ****kwargs**: Additional keyword arguments to pass to the superclass constructor. Any keyword argument you would pass to CloudLoggingHandler.
57
77
 
58
78
 
59
79
  ## Example of usage
@@ -74,6 +94,8 @@ if os.getenv('GAE_ENV', '').startswith('standard'):
74
94
 
75
95
  client = google.cloud.logging.Client()
76
96
  gae_log_handler = FastAPIGAELoggingHandler(app=app, client=client)
97
+ # use the log_payload parameter if you want to opt-out from payload logging
98
+ # gae_log_handler = FastAPIGAELoggingHandler(app=app, client=client, log_payload=False)
77
99
  setup_logging(handler=gae_log_handler)
78
100
 
79
101
  logging.getLogger().setLevel(logging.DEBUG)
@@ -37,7 +37,27 @@ The `fastapi-gae-logging` module addresses these problems by:
37
37
 
38
38
  ## API
39
39
 
40
- - `FastAPIGAELoggingHandler` class: A custom Cloud Logging Handler for FastAPI applications to use with the official google-cloud-logging library.
40
+ - Initialization
41
+
42
+ ```python
43
+ FastAPIGAELoggingHandler(
44
+ app: FastAPI,
45
+ request_logger_name: Optional[str] = None,
46
+ log_payload: bool = True,
47
+ *args, **kwargs
48
+ )
49
+ ```
50
+
51
+ - Parameters
52
+ - **app** (FastAPI): The FastAPI application instance.
53
+ - **request_logger_name** (Optional[str], optional): The name of the Cloud Logging logger to use for request logs.
54
+ Defaults to the Google Cloud Project ID with the suffix '-request-logger'.
55
+
56
+ - **log_payload** (bool, optional): Whether to log the request payload. If True, the payload for POST, PUT, PATCH, and DELETE requests will be logged. Defaults to True.
57
+
58
+ - ***args**: Additional arguments to pass to the superclass constructor. Any argument you would pass to CloudLoggingHandler.
59
+
60
+ - ****kwargs**: Additional keyword arguments to pass to the superclass constructor. Any keyword argument you would pass to CloudLoggingHandler.
41
61
 
42
62
 
43
63
  ## Example of usage
@@ -58,6 +78,8 @@ if os.getenv('GAE_ENV', '').startswith('standard'):
58
78
 
59
79
  client = google.cloud.logging.Client()
60
80
  gae_log_handler = FastAPIGAELoggingHandler(app=app, client=client)
81
+ # use the log_payload parameter if you want to opt-out from payload logging
82
+ # gae_log_handler = FastAPIGAELoggingHandler(app=app, client=client, log_payload=False)
61
83
  setup_logging(handler=gae_log_handler)
62
84
 
63
85
  logging.getLogger().setLevel(logging.DEBUG)
@@ -216,6 +216,9 @@ class FastAPIGAELoggingHandler(CloudLoggingHandler):
216
216
  app (FastAPI): The FastAPI application instance.
217
217
  request_logger_name (Optional[str]): The name of the Cloud Logging logger to use for request logs.
218
218
  Defaults to the Google Cloud Project ID with '-request-logger' suffix.
219
+ log_payload (bool): Whether to log the request payload. If True, the payload for
220
+ POST, PUT, PATCH, and DELETE requests will be logged.
221
+ Defaults to True.
219
222
  *args: Additional arguments to pass to the superclass constructor.
220
223
  Any argument you would pass to CloudLoggingHandler.
221
224
  **kwargs: Additional keyword arguments to pass to the superclass constructor.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastapi-gae-logging
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: Custom Cloud Logging handler for FastAPI applications deployed in Google App Engine. Groups logs coming from the same request lifecycle and propagates the maximum log level throughout the request lifecycle using middleware and context management.
5
5
  Home-page: https://github.com/chrisK824/fastapi-gae-logging
6
6
  Author: Chris Karvouniaris
@@ -53,7 +53,27 @@ The `fastapi-gae-logging` module addresses these problems by:
53
53
 
54
54
  ## API
55
55
 
56
- - `FastAPIGAELoggingHandler` class: A custom Cloud Logging Handler for FastAPI applications to use with the official google-cloud-logging library.
56
+ - Initialization
57
+
58
+ ```python
59
+ FastAPIGAELoggingHandler(
60
+ app: FastAPI,
61
+ request_logger_name: Optional[str] = None,
62
+ log_payload: bool = True,
63
+ *args, **kwargs
64
+ )
65
+ ```
66
+
67
+ - Parameters
68
+ - **app** (FastAPI): The FastAPI application instance.
69
+ - **request_logger_name** (Optional[str], optional): The name of the Cloud Logging logger to use for request logs.
70
+ Defaults to the Google Cloud Project ID with the suffix '-request-logger'.
71
+
72
+ - **log_payload** (bool, optional): Whether to log the request payload. If True, the payload for POST, PUT, PATCH, and DELETE requests will be logged. Defaults to True.
73
+
74
+ - ***args**: Additional arguments to pass to the superclass constructor. Any argument you would pass to CloudLoggingHandler.
75
+
76
+ - ****kwargs**: Additional keyword arguments to pass to the superclass constructor. Any keyword argument you would pass to CloudLoggingHandler.
57
77
 
58
78
 
59
79
  ## Example of usage
@@ -74,6 +94,8 @@ if os.getenv('GAE_ENV', '').startswith('standard'):
74
94
 
75
95
  client = google.cloud.logging.Client()
76
96
  gae_log_handler = FastAPIGAELoggingHandler(app=app, client=client)
97
+ # use the log_payload parameter if you want to opt-out from payload logging
98
+ # gae_log_handler = FastAPIGAELoggingHandler(app=app, client=client, log_payload=False)
77
99
  setup_logging(handler=gae_log_handler)
78
100
 
79
101
  logging.getLogger().setLevel(logging.DEBUG)
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="fastapi-gae-logging",
5
- version="0.0.4",
5
+ version="0.0.6",
6
6
  description="Custom Cloud Logging handler for FastAPI applications deployed in Google App Engine. \
7
7
  Groups logs coming from the same request lifecycle and propagates the maximum log level \
8
8
  throughout the request lifecycle using middleware and context management.",