Skip to content

filtering out 12.2.1.0 CIE error log messages from the Summary Handler #1327

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

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public class SummaryHandler extends WLSDeployLogEndHandler {
private static final int DEFAULT_MEMORY_BUFFER_SIZE = 3000;
private static final String DEFAULT_SIZE_PROPERTY_VALUE = Integer.toString(DEFAULT_MEMORY_BUFFER_SIZE);

// In 12.2.1.0.0, cd(), runCmd(), ls() errors percolate up into this handler. Use these constants
// to filter out the errors so that they are not counted.
//
private static final String CIE_EXCEPTION_CLASS = "com.oracle.cie.domain.script.jython.CommandExceptionHandler";
private static final String CIE_EXCEPTION_METHOD = "handleException";

private final int bufferSize;
private WLSDeployContext context;
private boolean suppressOutput = false;
Expand Down Expand Up @@ -304,6 +310,12 @@ private class LevelHandler extends MemoryHandler {
@Override
public synchronized void publish(LogRecord logRecord) {
if (logRecord.getLevel().equals(getLevel())) {
if (getLevel() == Level.SEVERE && isCieErrorLog(logRecord)) {
// Do not publish or count WLS 12.2.1.0 error logs from the CIE class
// related to cd(), runCmd(), ls(), etc.
//
return;
}
++totalRecords;
super.publish(logRecord);
}
Expand All @@ -312,5 +324,14 @@ public synchronized void publish(LogRecord logRecord) {
int getTotalRecords() {
return totalRecords;
}

private boolean isCieErrorLog(LogRecord logRecord) {
if (logRecord.getLevel() == Level.SEVERE
&& CIE_EXCEPTION_CLASS.equals(logRecord.getSourceClassName())
&& CIE_EXCEPTION_METHOD.equals(logRecord.getSourceMethodName())) {
return true;
}
return false;
}
}
}