[improve][broker] Add class name and line number output to the log. #22300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The current log file does not output the class name and line number. In some cases, it is difficult to quickly locate specific lines of code based on the log content.
Before optimization, we could only see the name of the logger, but we didn’t know which line of log output was of which class.
The log example is as follows:
After optimization, we print out the class name and line number, so we can quickly locate the specific line of code.
The log example is as follows:
Modifications
Add java class file name and line number output to the log.
"%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t] %-5level %logger{36} **(%F:%L)** - %msg%n"
Documentation
doc
doc-required
doc-not-needed
doc-complete