Skip to content

Commit 139a254

Browse files
Merge pull request #3 from CroffZ/CroffZ-patch-1
Update java-dynamic-log-level.md
2 parents 4044125 + 759871b commit 139a254

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

articles/container-apps/java-dynamic-log-level.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,39 @@ To take advantage of these diagnostic tools, you can create a new container app
2222
To create a new container app with JVM diagnostics enabled, use the following command:
2323

2424
```azurecli
25-
// TODO: replace this
26-
az containerapp java diagnostics enable --enable-java-agent \
25+
az containerapp create --enable-java-agent \
2726
--environment <ENVIRONMENT_NAME> \
2827
--resource-group <RESOURCE_GROUP> \
29-
--name <JAVA_COMPONENT_NAME>
28+
--name <CONTAINER_APP_NAME>
3029
```
3130

3231
To update an existing container app, use the following command:
3332

3433
```azurecli
35-
// TODO: replace this
36-
az containerapp create --enable-java-agent \
34+
az containerapp update --enable-java-agent \
3735
--environment <ENVIRONMENT_NAME> \
3836
--resource-group <RESOURCE_GROUP> \
39-
--name <JAVA_COMPONENT_NAME>
37+
--name <CONTAINER_APP_NAME>
4038
```
4139

4240
## Change runtime logger levels
4341

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.
47-
42+
After enabling JVM diagnostics, you can change runtime log levels for specific loggers in your running Java app without the need to restart it.
43+
44+
Use the following command to adjust log levels for a specific logger:
45+
4846
```azurecli
49-
// TODO: replace this
50-
az containerapp env java-component list \
47+
az containerapp java logger update \
48+
--logger-name "org.springframework.boot" \
49+
--level "info"
5150
--environment <ENVIRONMENT_NAME> \
52-
--resource-group <RESOURCE_GROUP>
51+
--resource-group <RESOURCE_GROUP> \
52+
--name <CONTAINER_APP_NAME>
5353
```
54+
55+
In this sample logger name is `"org.springframework.boot"` and desired log level is `"info"`. Change these to your own logger name and log level to help troubleshoot your Java app.
5456

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).
57+
It may 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).
5658

5759
## Supported Java logging frameworks
5860

0 commit comments

Comments
 (0)