Skip to content

Conversation

@benwtrent
Copy link
Member

This PR unifies our logging messages in the transform task so that they are easier to grok. Some new logging entries are added, but one logging message is removed (it was a hold over from previous debugging efforts).

Additionally, the "when to audit on checkpoint finish" logic is now changed so that we write an audit message for nicely rounded numbers such as 10, 100, and not 19, 99 or 199.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

listener.onResponse(new StartDataFrameTransformTaskAction.Response(true));
},
exc -> {
logger.error("[" + transform.getId() + "] failed updating state to [" + state + "].", exc);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use interpolation markers ("{}") here (and in other places) the same way as you did in line 355?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not possible to use interpolation and have an exception too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A, ok. Understand.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a ParameterizedMessage

Suggested change
logger.error("[" + transform.getId() + "] failed updating state to [" + state + "].", exc);
logger.error(new ParameterizedMessage("[{}] failed updating state to [{}].", transform.getId(), state), exc);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
I forgot about it. Seems like a perfect solution to maintain consistency of how the messages are crafted in this file.

@benwtrent
Copy link
Member Author

run elasticsearch-ci/1

@benwtrent
Copy link
Member Author

@elasticmachine update branch

@benwtrent benwtrent requested a review from przemekwitek August 21, 2019 15:02
Copy link
Contributor

@przemekwitek przemekwitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor comments, otherwise LGTM


synchronized void handleFailure(Exception e) {
logger.warn("Data frame transform [" + transformTask.getTransformId() + "] encountered an exception: ", e);
logger.warn(new ParameterizedMessage("[{} data frame transform encountered an exception: ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing ']'

} catch (Exception e) {
logger.error("Data frame transform encountered an unexpected internal exception: " ,e);
logger.error(
new ParameterizedMessage("[{} data frame transform encountered an unexpected internal exception: ", transformId),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing ']'

@benwtrent benwtrent merged commit 36d859f into elastic:master Aug 22, 2019
@benwtrent benwtrent deleted the feature/ml-df-checkpoint-logging-fixes branch August 22, 2019 14:52
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Aug 22, 2019
…45788)

* [ML][Transforms] unifying logging, adding some more logging

* using parameterizedMessage instead of string concat

* fixing bracket closure
benwtrent added a commit that referenced this pull request Aug 22, 2019
…45859)

* [ML][Transforms] unifying logging, adding some more logging

* using parameterizedMessage instead of string concat

* fixing bracket closure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants