-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve logging in ledger API server [DPP-231] #8676
Conversation
@mziolekda Could you review changes and point out which information worth logging I haven't included in this draft? |
eec2e6f
to
ccdb108
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it basically looks ok, I've added a few notes here and there.
...ation-api/src/main/scala/platform/apiserver/services/admin/ApiPackageManagementService.scala
Show resolved
Hide resolved
...tion-api/src/main/scala/platform/apiserver/services/admin/ApiParticipantPruningService.scala
Outdated
Show resolved
Hide resolved
...gration-api/src/main/scala/platform/apiserver/services/admin/ApiPartyManagementService.scala
Show resolved
Hide resolved
...gration-api/src/main/scala/platform/apiserver/services/admin/ApiPartyManagementService.scala
Outdated
Show resolved
Hide resolved
...gration-api/src/main/scala/platform/apiserver/services/admin/ApiPartyManagementService.scala
Outdated
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/store/dao/JdbcLedgerDao.scala
Outdated
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/store/dao/JdbcLedgerDao.scala
Outdated
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/store/dao/JdbcLedgerDao.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (but maybe wait for someone from your team to approve as well, if you think that makes sense)
638ca92
to
a22c0c6
Compare
...ation-api/src/main/scala/platform/apiserver/services/transaction/ApiTransactionService.scala
Outdated
Show resolved
Hide resolved
...integration-api/src/main/scala/platform/apiserver/services/ApiCommandCompletionService.scala
Outdated
Show resolved
Hide resolved
...ation-api/src/main/scala/platform/apiserver/services/transaction/ApiTransactionService.scala
Outdated
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/store/dao/JdbcLedgerDao.scala
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/store/dao/JdbcLedgerDao.scala
Outdated
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/store/dao/JdbcLedgerDao.scala
Outdated
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/store/dao/JdbcLedgerDao.scala
Outdated
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/store/dao/JdbcLedgerDao.scala
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/store/dao/JdbcLedgerDao.scala
Show resolved
Hide resolved
Judging from @mziolekda's most recent comments it appears that many of the keys that are being inserted in this PR were actually already there. It would probably be best to have a second look at this. |
9f9242a
to
4e072ab
Compare
): Map[String, String] = | ||
Map( | ||
logging.commandId(commandId), | ||
"statusCode" -> statusCode.map(_.toString).getOrElse(""), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"statusCode" -> statusCode.map(_.toString).getOrElse(""), | |
"statusCode" -> statusCode.mkString, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it's not possible with our current Scala compiler settings. Specifically, compilation will fail with:
error: [wartremover:Option2Iterable] Implicit conversion from Option to Iterable is disabled - use Option#toList instead
I could use statusCode.toList.mkString
but it looks a bit strange to create a list only for mkString
. What do you think?
...ration-api/src/main/scala/platform/apiserver/services/admin/ApiConfigManagementService.scala
Show resolved
Hide resolved
ledger/participant-integration-api/src/main/scala/platform/indexer/ExecuteUpdate.scala
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks ok now, thanks
…nagement, PackageManagement, ParticipantPruning and PartyManagement CHANGELOG_BEGIN - Logging incoming requests in API services CHANGELOG_END
…tionService CHANGELOG_BEGIN - Logging transactions and transaction trees returned by the ApiTransactionService CHANGELOG_END
b91d438
to
869ef17
Compare
@@ -110,7 +110,7 @@ private[apiserver] final class ApiSubmissionService private ( | |||
|
|||
override def submit(request: SubmitRequest): Future[Unit] = | |||
withEnrichedLoggingContext(logging.commands(request.commands)) { implicit loggingContext => | |||
logger.debug("Submitting transaction") | |||
logger.info("Submitting transaction") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kamil-da , don't you feel logging every submission at info level might turn out to be a bit verbose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oliverse-da Thank you for the comment.
Actually I think it may be more reasonable to lower the level to debug.
This change was explicitly requested by @mziolekda , so his input might be valuable here as well.
Motivation
Troubleshooting is made unnecessarily hard by lack of adequate logging. Every client request should be logged at the info level as it enters and leaves the system.
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.