Skip to content

Commit a2e0fe4

Browse files
Merge pull request #1 from craigshoemaker/aca/croffz/main
[Container Apps] Update: Java change log levels (copy edit)
2 parents ead50e9 + 254ae7c commit a2e0fe4

File tree

1 file changed

+36
-24
lines changed

1 file changed

+36
-24
lines changed
Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
---
22
title: Use dynamic logger level settings for troubleshooting Java applications in Azure Container Apps (preview)
3-
description: Learn how to leverage dynamic logger level settings to debug your Java applications running on Azure Container Apps.
3+
description: Learn how to use dynamic logger level settings to debug your Java applications running on Azure Container Apps.
44
services: container-apps
55
author: craigshoemaker
66
ms.service: container-apps
7-
ms.custom: devx-track-azurecli
87
ms.topic: how-to
9-
ms.date: 03/13/2024
8+
ms.date: 05/10/2024
109
ms.author: cshoe
1110
---
1211

1312
# Use dynamic logger level settings for troubleshooting Java applications in Azure Container Apps (preview)
1413

15-
Azure Container Apps platform offers a built-in diagnostics tool exclusively for Java developers to help them debug and troubleshoot their Java applications running on Azure Container Apps more easily and effeiciently. One of the key functionalities provided is dynamic logger level change, which allows developers to get more hidden information from app logs without modifying code and restarting apps.
14+
Azure Container Apps platform offers a built-in diagnostics tool exclusively for Java developers to help them debug and troubleshoot their Java applications running on Azure Container Apps more easily and efficiently. One of the key features is a dynamic logger level change, which allows you to get more hidden information from app logs without modifying code and restarting apps.
1615

1716
## Enable JVM diagnostics for your Java applications
1817

19-
Before using the Java diagnostics tool, you need to enable JVM diagnostics for your Azure Container Apps first. This step will unblock Java diagnostics functionalities by injecting an advanced diagnostics agent into your app and may restart it.
18+
Before using the Java diagnostics tool, you need to first enable Java Virtual Machine (JVM) diagnostics for your Azure Container Apps. This step enables Java diagnostics functionality by injecting an advanced diagnostics agent into your app. Your app might restart during this process.
2019

21-
Create a new Azure Container Apps with JVM diagnostics enabled:
20+
To take advantage of these diagnostic tools, you can create a new container app with them enabled, or update an existing container app.
21+
22+
To create a new container app with JVM diagnostics enabled, use the following command:
2223

2324
```azurecli
2425
// TODO: replace this
@@ -28,7 +29,7 @@ az containerapp java diagnostics enable --enable-java-agent \
2829
--name <JAVA_COMPONENT_NAME>
2930
```
3031

31-
Update an existing Azure Container Apps to enable JVM diagnostics:
32+
To update an existing container app, use the following command:
3233

3334
```azurecli
3435
// TODO: replace this
@@ -40,7 +41,9 @@ az containerapp create --enable-java-agent \
4041

4142
## Change runtime logger levels
4243

43-
After enabling JVM diagnostics, you can change runtime logger levels without interruptting your running apps now.
44+
After enabling JVM diagnostics, you can change runtime logger levels without interrupting your running apps.
45+
46+
Use the following command to adjust the logger levels in your Java application.
4447

4548
```azurecli
4649
// TODO: replace this
@@ -49,32 +52,41 @@ az containerapp env java-component list \
4952
--resource-group <RESOURCE_GROUP>
5053
```
5154

52-
It may take up to 2 minutes for the logger level change to take effect. You can then check out your app logs from [Log streaming](log-streaming.md) or other [Log options](log-options.md).
55+
It could take up to two minutes for the logger level change to take effect. Once complete, you can check the application logs from [log streams](log-streaming.md) or other [log options](log-options.md).
5356

5457
## Supported Java logging frameworks
5558

56-
Currently most of those popular Java logging frameworks are supported: [Log4j2](https://logging.apache.org/log4j/2.x/), [SLF4J](https://slf4j.org/), [jboss-logging](https://github.com/jboss-logging/jboss-logging). For Log4j, only version 2.* is supported.
59+
The following Java logging frameworks are supported:
60+
61+
- [Log4j2](https://logging.apache.org/log4j/2.x/) (only version 2.*)
62+
- [SLF4J](https://slf4j.org/)
63+
- [jboss-logging](https://github.com/jboss-logging/jboss-logging)
5764

5865
### Supported log levels by different logging frameworks
5966

60-
Different logging frameworks have different log levels supported. In JVM diagnostics platform, some of them are supported as well but others are not yet. If you are using a specific logging framework and you want to use dynamic log level change, you need to make sure those log levels you are using are supported by both framework and platform.
67+
Different logging frameworks support different log levels. In the JVM diagnostics platform, some frameworks are better supported than others. Before changing logging levels, make sure the log levels you're using are supported by both the framework and platform.
6168

62-
| Framework | OFF | FATAL | ERROR | WARN | INFO | DEBUG | TRACE | ALL |
69+
| Framework | Off | Fatal | Error | Warn | Info | Debug | Trace | All |
6370
|---------------|-------|-------|-------|------|------|-------|-------|-----|
64-
| Log4j2 | YES | YES | YES | YES | YES | YES | YES | YES |
65-
| SLF4J | YES | YES | YES | YES | YES | YES | YES | YES |
66-
| jboss-logging | NO | YES | YES | YES | YES | YES | YES | NO |
67-
| **Platform** | YES | NO | YES | YES | YES | YES | YES | NO |
71+
| Log4j2 | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
72+
| SLF4J | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
73+
| jboss-logging | No | Yes | Yes | Yes | Yes | Yes | Yes | No |
74+
| **Platform** | Yes | No | Yes | Yes | Yes | Yes | Yes | No |
6875

6976
### General visibility of log levels
7077

71-
| Log Level | FATAL | ERROR | WARN | INFO | DEBUG | TRACE | ALL |
78+
| Log Level | Fatal | Error | Warn | Info | Debug | Trace | All |
7279
|-----------|-------|-------|------|------|-------|-------|-----|
7380
| **OFF** | | | | | | | |
74-
| **FATAL** | YES | | | | | | |
75-
| **ERROR** | YES | YES | | | | | |
76-
| **WARN** | YES | YES | YES | | | | |
77-
| **INFO** | YES | YES | YES | YES | | | |
78-
| **DEBUG** | YES | YES | YES | YES | YES | | |
79-
| **TRACE** | YES | YES | YES | YES | YES | YES | |
80-
| **ALL** | YES | YES | YES | YES | YES | YES | YES |
81+
| **FATAL** | Yes | | | | | | |
82+
| **ERROR** | Yes | Yes | | | | | |
83+
| **WARN** | Yes | Yes | Yes | | | | |
84+
| **INFO** | Yes | Yes | Yes | Yes | | | |
85+
| **DEBUG** | Yes | Yes | Yes | Yes | Yes | | |
86+
| **TRACE** | Yes | Yes | Yes | Yes | Yes | Yes | |
87+
| **ALL** | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
88+
89+
## Related content
90+
91+
> [!div class="nextstepaction"]
92+
> [Log steaming](./log-streaming.md)

0 commit comments

Comments
 (0)