aws-greengrass / aws-greengrass/aws-greengrass-stream-manager-sdk-java
Incorrect format of Stream manager Logs
- Dominant language
- No language data
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I'd like to ask you for assistance:
When using JSON format of Greengrass Nucleus Logs, in CloudWatch the messages are correctly formatted (there is one message per exception and it has everything filled in the stack trace field
```
"message": "Failed to publish the message via Spooler and will retry",
"contexts": {},
"loggerName": "com.aws.greengrass.mqttclient.MqttClient",
"timestamp": 1752146074985,
"cause": {
"message": "software.amazon.awssdk.crt.CrtRuntimeException: Mqtt5 operation failed due to a disconnection event in conjunction with the client's offline queue retention policy. AWS_ERROR_MQTT5_OPERATION_FAILED_DUE_TO_OFFLINE_QUEUE_POLICY(5156)",
"suppressed": [],
"stackTrace": [
{
"classLoaderName": null,
"moduleName": "java.base",
"moduleVersion": "17.0.15",
"methodName": "encodeThrowable",
"fileName": "CompletableFuture.java",
"lineNumber": 332,
"nativeMethod": false,
"className": "java.util.concurrent.CompletableFuture"
},
{
"classLoaderName": null,
"moduleName": "java.base",
"moduleVersion": "17.0.15",
"methodName": "completeThrowable",
"fileName": "CompletableFuture.java",
"lineNumber": 347,
"nativeMethod": false,
"className": "java.util.concurrent.CompletableFuture"
},
{
"classLoaderName": null,
"moduleName": "java.base",
"moduleVersion": "17.0.15",
"methodName": "tryFire",
"fileName": "CompletableFuture.java",
"lineNumber": 636,
"nativeMethod": false,
"className": "java.util.concurrent.CompletableFuture$UniApply"
},
{
"classLoaderName": null,
"moduleName": "java.base",
"moduleVersion": "17.0.15",
"methodName": "postComplete",
"fileName": "CompletableFuture.java",
"lineNumber": 510,
"nativeMethod": false,
"className": "java.util.concurrent.CompletableFuture"
},
{
"classLoaderName": null,
"moduleName": "java.base",
"moduleVersion": "17.0.15",
"methodName": "completeExceptionally",
"fileName": "CompletableFuture.java",
"lineNumber": 2162,
"nativeMethod": false,
"className": "java.util.concurrent.CompletableFuture"
}
],
"cause": {
"message": "Mqtt5 operation failed due to a disconnection event in conjunction with the client's offline queue retention policy.",
"suppressed": [],
"stackTrace": [],
"cause": null
}
}
```
However in Stream Manager, each line of the stack trace is a separate message, causing stack traces to be very hard to read in Cloudwatch and also causing high amount of data bloat (BTW Java exception is logged at INFO level):
```
{
"thread": "Copier",
"level": "INFO",
"eventType": "stdout",
"message": "at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) [?:?]",
"contexts": {
"scriptName": "services.aws.greengrass.StreamManager.lifecycle.startup.Script",
"serviceName": "aws.greengrass.StreamManager",
"currentState": "RUNNING"
},
"loggerName": "aws.greengrass.StreamManager",
"timestamp": 1752145683649,
"cause": null
}
2025-07-10T11:08:03.649Z
{
"thread": "Copier",
"level": "INFO",
"eventType": "stdout",
"message": "at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]",
"contexts": {
"scriptName": "services.aws.greengrass.StreamManager.lifecycle.startup.Script",
"serviceName": "aws.greengrass.StreamManager",
"currentState": "RUNNING"
},
"loggerName": "aws.greengrass.StreamManager",
"timestamp": 1752145683649,
"cause": null
}
2025-07-10T11:08:03.650Z
{
"thread": "Copier",
"level": "INFO",
"eventType": "stdout",
"message": "at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]",
"contexts": {
"scriptName": "services.aws.greengrass.StreamManager.lifecycle.startup.Script",
"serviceName": "aws.greengrass.StreamManager",
"currentState": "RUNNING"
},
"loggerName": "aws.greengrass.StreamManager",
"timestamp": 1752145683650,
"cause": null
}
```
Another problem: setting StreamManager `LOG_LEVEL` to WARN does not do anything, Stream Manager keeps on logging as INFO
Stream Manager Version: 2.2.0
Nucleus : 2.14.3
Thank you
Tomas
Contributor guide
Research direction
Start by reproducing the Stream Manager logging behavior with Stream Manager 2.2.0 and Nucleus 2.14.3, including JSON logs, stack traces, and LOG_LEVEL=WARN. Done means stack traces are not split into separate CloudWatch messages and WARN suppresses INFO output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- cloud, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100