Skip to content
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

Adds a setting to control source output in indexing slowlog #12806

Merged
merged 1 commit into from Aug 11, 2015

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Aug 11, 2015

Instead of logging the entire _source in the indexing slowlog we log by default just the first 1000 characters - this is controlled by the index.indexing.slowlog.source settings and can be set to true to log the whole _source, false to log none of it, and a number to log at most that many characters.

Closes #4485

@nik9000 nik9000 added review :Search/Mapping Index mappings, including merging and defining field types :Core/Infra/Logging Log management and logging utilities labels Aug 11, 2015
@nik9000
Copy link
Member Author

nik9000 commented Aug 11, 2015

@jpountz, this could use a review.

* high surrogates.
*/
public static String cleanTruncate(String s, int length) {
if (length > s.length()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

s/>/>=/ ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah - no need to substring in the equals case either.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@clintongormley clintongormley added v2.0.0-beta1 and removed :Search/Mapping Index mappings, including merging and defining field types labels Aug 11, 2015
@@ -55,18 +62,27 @@
public static final String INDEX_INDEXING_SLOWLOG_THRESHOLD_INDEX_TRACE = INDEX_INDEXING_SLOWLOG_PREFIX +".threshold.index.trace";
public static final String INDEX_INDEXING_SLOWLOG_REFORMAT = INDEX_INDEXING_SLOWLOG_PREFIX +".reformat";
public static final String INDEX_INDEXING_SLOWLOG_LEVEL = INDEX_INDEXING_SLOWLOG_PREFIX +".level";
public static final String INDEX_INDEXING_SLOWLOG_MAX_SOURCE_CHARS_TO_LOG = INDEX_INDEXING_SLOWLOG_PREFIX + ".source";
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe also rename the setting? (in addition to the constant)

Copy link
Member Author

Choose a reason for hiding this comment

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

I kinda like how simple the setting is though. It makes sense because you can set it to false and get no source and true and get it all....

@jpountz
Copy link
Contributor

jpountz commented Aug 11, 2015

LGTM

@nik9000 nik9000 force-pushed the slowlog branch 3 times, most recently from 102dfc7 to b391bfe Compare August 11, 2015 20:13
@nik9000
Copy link
Member Author

nik9000 commented Aug 11, 2015

Ok - rebased and squashed. I reset the author to myself - this was based on @metadave's work in #12655 but little of it remains. Some. But not much. At this point I'm the better person to contact if something goes wrong with this code.

I'll rerun the tests one last time and merge.

Instead of logging the entire `_source` in the indexing slowlog we log by
default just the first 1000 characters - this is controlled by the
`index.indexing.slowlog.source` settings and can be set to `true` to log the
whole `_source`, `false` to log none of it, and a number to log at most that
many characters.

Closes elastic#4485
nik9000 added a commit that referenced this pull request Aug 11, 2015
Adds a setting to control source output in indexing slowlog
@nik9000 nik9000 merged commit 152178f into elastic:master Aug 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Logging Log management and logging utilities >enhancement v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants