Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions docs/django.rst
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,26 @@ In order to include querystrings in the request summary log, set this flag in se
DOCKERFLOW_SUMMARY_LOG_QUERYSTRING = True


A unique request ID is read from the `X-Request-ID` request header, and a UUID4 value is generated if unset.
MozLog App-Specific Fields
~~~~~~~~~~~~~~~~~~~~~~~~~~

Leveraging the `RequestIdFilter` in logging configuration as shown above will add a ``rid`` attribute to all log messages.
The *MozLog* formatter will output ``Fields`` application-specific fields. It can be populated through the ``extra`` parameter:

.. code-block:: python

logger.info(
"Subsystem %s running at %s:%s",
name, host, port,
extra={"phase": "started", "host": host, "port": port}
)


Requests Correlation ID
~~~~~~~~~~~~~~~~~~~~~~~

A unique request ID is read from the ``X-Request-ID`` request header, and a UUID4 value is generated if unset.

Leveraging the ``RequestIdFilter`` in logging configuration as shown above will add a ``rid`` field into the ``Fields`` entry of all log messages.

The header name to obtain the request ID can be customized in settings:

Expand Down
22 changes: 20 additions & 2 deletions docs/fastapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,27 @@ In order to include querystrings in the request summary log, set this flag in th

app.state.DOCKERFLOW_SUMMARY_LOG_QUERYSTRING = True

A unique request ID is read from the `X-Request-ID` request header using the `RequestIdMiddleware` middleware (see :ref:`fastapi-setup`), and a UUID4 value is generated if unset.

Leveraging the `RequestIdFilter` in logging configuration as shown above will add a ``rid`` attribute to all log messages.
MozLog App-Specific Fields
~~~~~~~~~~~~~~~~~~~~~~~~~~

The *MozLog* formatter will output ``Fields`` application-specific fields. It can be populated through the ``extra`` parameter:

.. code-block:: python

logger.info(
"Subsystem %s running at %s:%s",
name, host, port,
extra={"phase": "started", "host": host, "port": port}
)


Requests Correlation ID
~~~~~~~~~~~~~~~~~~~~~~~

A unique request ID is read from the ``X-Request-ID`` request header, and a UUID4 value is generated if unset.

Leveraging the ``RequestIdFilter`` in logging configuration as shown above will add a ``rid`` field into the ``Fields`` entry of all log messages.

The header name to obtain the request ID can be customized in settings:

Expand Down
22 changes: 20 additions & 2 deletions docs/flask.rst
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,27 @@ In order to include querystrings in the request summary log, set this flag in :r

DOCKERFLOW_SUMMARY_LOG_QUERYSTRING = True

A unique request ID is read from the `X-Request-ID` request header, and a UUID4 value is generated if unset.

Leveraging the `RequestIdFilter` in logging configuration as shown above will add a ``rid`` attribute to all log messages.
MozLog App-Specific Fields
~~~~~~~~~~~~~~~~~~~~~~~~~~

The *MozLog* formatter will output ``Fields`` application-specific fields. It can be populated through the ``extra`` parameter:

.. code-block:: python

logger.info(
"Subsystem %s running at %s:%s",
name, host, port,
extra={"phase": "started", "host": host, "port": port}
)


Requests Correlation ID
~~~~~~~~~~~~~~~~~~~~~~~

A unique request ID is read from the ``X-Request-ID`` request header, and a UUID4 value is generated if unset.

Leveraging the ``RequestIdFilter`` in logging configuration as shown above will add a ``rid`` field into the ``Fields`` entry of all log messages.

The header name to obtain the request ID can be customized in settings:

Expand Down
22 changes: 20 additions & 2 deletions docs/sanic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,27 @@ In order to include querystrings in the request summary log, set this flag in :r

DOCKERFLOW_SUMMARY_LOG_QUERYSTRING = True

A unique request ID is read from the `X-Request-ID` request header, and a UUID4 value is generated if unset.

Leveraging the `RequestIdFilter` in logging configuration as shown above will add a ``rid`` attribute to all log messages.
MozLog App-Specific Fields
~~~~~~~~~~~~~~~~~~~~~~~~~~

The *MozLog* formatter will output ``Fields`` application-specific fields. It can be populated through the ``extra`` parameter:

.. code-block:: python

logger.info(
"Subsystem %s running at %s:%s",
name, host, port,
extra={"phase": "started", "host": host, "port": port}
)


Requests Correlation ID
~~~~~~~~~~~~~~~~~~~~~~~

A unique request ID is read from the ``X-Request-ID`` request header, and a UUID4 value is generated if unset.

Leveraging the ``RequestIdFilter`` in logging configuration as shown above will add a ``rid`` field into the ``Fields`` entry of all log messages.

The header name to obtain the request ID can be customized in settings:

Expand Down