3997 make new logger message SEVERE leave existing one as FINE

This commit is contained in:
William Schaefer 2018-07-06 12:11:18 -04:00
parent c819391112
commit 420a3fffe8
2 changed files with 38 additions and 20 deletions

View File

@ -986,13 +986,25 @@ abstract class AbstractSqlEamDb implements EamDb {
if (!eamArtifact.getCorrelationValue().isEmpty()) { if (!eamArtifact.getCorrelationValue().isEmpty()) {
if (eamInstance.getCorrelationCase() == null) { if (eamInstance.getCorrelationCase() == null) {
throw new EamDbException("CorrelationAttributeInstance case is null for :"); throw new EamDbException("CorrelationAttributeInstance case is null for: "
+ "\n\tCorrelationArtifact ID: " + eamArtifact.getID()
+ "\n\tCorrelationArtifact Type: " + eamArtifact.getCorrelationType().getDisplayName()
+ "\n\tCorrelationArtifact Value: " + eamArtifact.getCorrelationValue());
} }
if (eamInstance.getCorrelationDataSource() == null) { if (eamInstance.getCorrelationDataSource() == null) {
throw new EamDbException("CorrelationAttributeInstance data source is null"); throw new EamDbException("CorrelationAttributeInstance data source is null for: "
+ "\n\tCorrelationArtifact ID: " + eamArtifact.getID()
+ "\n\tCorrelationArtifact Type: " + eamArtifact.getCorrelationType().getDisplayName()
+ "\n\tCorrelationArtifact Value: " + eamArtifact.getCorrelationValue());
} }
if (eamInstance.getKnownStatus() == null) { if (eamInstance.getKnownStatus() == null) {
throw new EamDbException("CorrelationAttributeInstance known status is null"); throw new EamDbException("CorrelationAttributeInstance known status is null for: "
+ "\n\tCorrelationArtifact ID: " + eamArtifact.getID()
+ "\n\tCorrelationArtifact Type: " + eamArtifact.getCorrelationType().getDisplayName()
+ "\n\tCorrelationArtifact Value: " + eamArtifact.getCorrelationValue()
+ "\n\tEam Instance: "
+ "\n\t\tCaseId: " + eamInstance.getCorrelationDataSource().getCaseID()
+ "\n\t\tDeviceID: " + eamInstance.getCorrelationDataSource().getDeviceID());
} }
if (eamArtifact.getCorrelationValue().length() < MAX_VALUE_LENGTH) { if (eamArtifact.getCorrelationValue().length() < MAX_VALUE_LENGTH) {
@ -1010,13 +1022,13 @@ abstract class AbstractSqlEamDb implements EamDb {
bulkPs.addBatch(); bulkPs.addBatch();
} else { } else {
logger.log(Level.WARNING, ("Artifact value too long for central repository." logger.log(Level.WARNING, ("Artifact value too long for central repository."
+ "\nCorrelationArtifact ID: " + eamArtifact.getID() + "\n\tCorrelationArtifact ID: " + eamArtifact.getID()
+ "\nCorrelationArtifact Type: " + eamArtifact.getCorrelationType().getDisplayName() + "\n\tCorrelationArtifact Type: " + eamArtifact.getCorrelationType().getDisplayName()
+ "\nCorrelationArtifact Value: " + eamArtifact.getCorrelationValue()) + "\n\tCorrelationArtifact Value: " + eamArtifact.getCorrelationValue())
+ "\nEam Instance: " + "\n\tEam Instance: "
+ "\n\tCaseId: " + eamInstance.getCorrelationDataSource().getCaseID() + "\n\t\tCaseId: " + eamInstance.getCorrelationDataSource().getCaseID()
+ "\n\tDeviceID: " + eamInstance.getCorrelationDataSource().getDeviceID() + "\n\t\tDeviceID: " + eamInstance.getCorrelationDataSource().getDeviceID()
+ "\n\tFilePath: " + eamInstance.getFilePath()); + "\n\t\tFilePath: " + eamInstance.getFilePath());
} }
} }
} }

View File

@ -237,13 +237,19 @@ class SearchEngineURLQueryAnalyzer extends Extract {
try { //try to decode the url try { //try to decode the url
String decoded = URLDecoder.decode(x, "UTF-8"); //NON-NLS String decoded = URLDecoder.decode(x, "UTF-8"); //NON-NLS
return decoded; return decoded;
} catch (UnsupportedEncodingException | IllegalArgumentException exception) { //if it fails, return the encoded string } catch (UnsupportedEncodingException exception) { //if it fails, return the encoded string
logger.log(Level.FINE, "Error during URL decoding, returning undecoded value:" logger.log(Level.FINE, "Error during URL decoding, returning undecoded value:"
+ "\nURL: " + url + "\n\tURL: " + url
+ "\nUndecoded value: " + x + "\n\tUndecoded value: " + x
+ "\nEngine name: " + eng.getEngineName() + "\n\tEngine name: " + eng.getEngineName()
+ "\nEngine domain: " + eng.getDomainSubstring(), exception); //NON-NLS + "\n\tEngine domain: " + eng.getDomainSubstring(), exception); //NON-NLS
return x;
} catch (IllegalArgumentException exception) { //if it fails, return the encoded string
logger.log(Level.SEVERE, "Illegal arguement Exception during URL decoding, returning undecoded value:"
+ "\n\tURL: " + url
+ "\n\tUndecoded value: " + x
+ "\n\tEngine name: " + eng.getEngineName()
+ "\n\tEngine domain: " + eng.getDomainSubstring(), exception); //NON-NLS)
return x; return x;
} }
} }