Skip to content

Commit c570808

Browse files
committed
Added text around logging and updated snip lines
1 parent 1646ca4 commit c570808

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/app-service/tutorial-python-postgresql-app-fastapi.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,16 @@ With the PostgreSQL database protected by the virtual network, the easiest way t
303303

304304
## 6. Stream diagnostic logs
305305

306-
Azure App Service captures all messages output to the console to help you diagnose issues with your application. The sample app includes `print()` statements to demonstrate this capability as shown below.
306+
yThe sample app uses the Python Standard Library logging module to help you diagnose issues with your application. The sample app includes calls to the logger as shown below.
307307

308-
:::code language="python" source="~/msdocs-fastapi-postgresql-sample-app/src/fastapi_app/app.py" range="33-40" highlight="3":::
308+
:::code language="python" source="~/msdocs-fastapi-postgresql-sample-app/src/fastapi_app/app.py" range="39-46" highlight="3":::
309309

310310
:::row:::
311311
:::column span="2":::
312312
**Step 1:** In the App Service page:
313313
1. From the left menu, select **App Service logs**.
314314
1. Under **Application logging**, select **File System**.
315-
1. In the top menu, select **Save**.
315+
1. In the top menu, select **Save**.
316316
:::column-end:::
317317
:::column:::
318318
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-stream-diagnostic-logs-1.png" alt-text="A screenshot showing how to enable native logs in App Service in the Azure portal." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-stream-diagnostic-logs-1.png":::
@@ -420,7 +420,7 @@ The azd template generates the connectivity variables for you as [app settings](
420420
421421
1. `AZURE_POSTGRESQL_CONNECTIONSTRING` contains the connection string to the Postgres database in Azure. You need to use it in your code to connect to it. You can find the code that uses this environment variable in *src/fastapi/models.py*:
422422
423-
:::code language="python" source="~/msdocs-fastapi-postgresql-sample-app/src/fastapi_app/models.py" range="9-36" highlight="4-16":::
423+
:::code language="python" source="~/msdocs-fastapi-postgresql-sample-app/src/fastapi_app/models.py" range="13-40" highlight="4-16":::
424424
425425
## 3. Examine the startup command
426426
@@ -475,11 +475,11 @@ In this section, you'll run this command manually for demonstration purposes. Wi
475475
476476
## 6. Stream diagnostic logs
477477
478-
Azure App Service can capture console logs to help you diagnose issues with your application. For convenience, the azd template has already [enabled logging to the local file system](troubleshoot-diagnostic-logs.md#enable-application-logging-linuxcontainer) as well as [shipping them to a Log Analytics workspace](troubleshoot-diagnostic-logs.md#send-logs-to-azure-monitor).
478+
Azure App Service can capture logs to help you diagnose issues with your application. For convenience, the azd template has already [enabled logging to the local file system](troubleshoot-diagnostic-logs.md#enable-application-logging-linuxcontainer) as well as [shipping them to a Log Analytics workspace](troubleshoot-diagnostic-logs.md#send-logs-to-azure-monitor).
479479
480-
The sample app includes `print()` statements to demonstrate this capability as shown in the following snippet.
480+
The sample app uses the Python Standard Library logging module to output logs. The sample app includes calls to the logger as shown below.
481481
482-
:::code language="python" source="~/msdocs-fastapi-postgresql-sample-app/src/fastapi_app/app.py" range="33-40" highlight="3":::
482+
:::code language="python" source="~/msdocs-fastapi-postgresql-sample-app/src/fastapi_app/app.py" range="39-46" highlight="3":::
483483
484484
In the azd output, find the link to stream App Service logs and navigate to it in the browser. The link looks like this in the azd output:
485485

0 commit comments

Comments
 (0)