-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '6.6.x' of github.com:apereo/cas into 6.6.x
# Conflicts: # gradle.properties
- Loading branch information
Showing
22 changed files
with
399 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
api/cas-server-core-api-util/src/main/java/org/apereo/cas/util/LogMessageSummarizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.apereo.cas.util; | ||
|
||
import org.slf4j.Logger; | ||
|
||
/** | ||
* This is {@link LogMessageSummarizer}. | ||
* | ||
* @author Hal Deadman | ||
* @since 6.6.0 | ||
*/ | ||
public interface LogMessageSummarizer { | ||
|
||
/** | ||
* Method to let summarizer determine whether to summarize or not. | ||
* @param logger Logger logging the message | ||
* @return true True if should summarize | ||
*/ | ||
boolean shouldSummarize(Logger logger); | ||
|
||
/** | ||
* Summarize stack trace. | ||
* @param message Log message | ||
* @param throwable Throwable to summarize | ||
* @return Summarized Message | ||
*/ | ||
String summarizeStackTrace(String message, Throwable throwable); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
core/cas-server-core-services/src/test/resources/uid.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
logger.info("Testing username attribute for attributes $attributes and service ${service.id}") | ||
return "test" | ||
|
||
def run(Object[] args) { | ||
def attributes = args[0] | ||
def id = args[1] | ||
def service = args[2] | ||
def logger = args[3] | ||
logger.info("Testing username attribute for attributes $attributes and service ${service.id}") | ||
return "fromscript" | ||
} |
29 changes: 29 additions & 0 deletions
29
...s-server-core-util-api/src/main/java/org/apereo/cas/util/DefaultLogMessageSummarizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.apereo.cas.util; | ||
|
||
import lombok.val; | ||
import org.slf4j.Logger; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* Default implementation of LogMessageSummarizer summarizes throwable if log level higher than debug. | ||
* @author Misagh Moayyed | ||
* @since 6.6.0 | ||
*/ | ||
public class DefaultLogMessageSummarizer implements LogMessageSummarizer { | ||
|
||
@Override | ||
public boolean shouldSummarize(final Logger logger) { | ||
return !logger.isDebugEnabled(); | ||
} | ||
|
||
@Override | ||
public String summarizeStackTrace(final String message, final Throwable throwable) { | ||
val builder = new StringBuilder(message).append('\n'); | ||
Arrays.stream(throwable.getStackTrace()).limit(3).forEach(trace -> { | ||
val error = String.format("\t%s:%s:%s%n", trace.getFileName(), trace.getMethodName(), trace.getLineNumber()); | ||
builder.append(error); | ||
}); | ||
return builder.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...re-util-api/src/main/resources/META-INF/services/org.apereo.cas.util.LogMessageSummarizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.apereo.cas.util.DefaultLogMessageSummarizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...as-server-core-util-api/src/test/java/org/apereo/cas/util/LoggingUtilsSummarizeTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.apereo.cas.util; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
|
||
/** | ||
* This is {@link LoggingUtilsSummarizeTests} configured with log level higher than debug to trigger summarize logic. | ||
* | ||
* @author Hal Deadman | ||
* @since 6.6.0 | ||
*/ | ||
@Tag("Utility") | ||
@Slf4j | ||
public class LoggingUtilsSummarizeTests { | ||
@Test | ||
public void verifyOperation() { | ||
assertDoesNotThrow(() -> { | ||
LoggingUtils.error(LOGGER, "error", new RuntimeException("error")); | ||
LoggingUtils.warn(LOGGER, "error", new RuntimeException("error")); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# Platform metadata for releases, POM generation, etc. | ||
################################################# | ||
group=org.apereo.cas | ||
version=6.6.3 | ||
version=6.6.4-SNAPSHOT | ||
projectUrl=https://www.apereo.org/cas | ||
projectInceptionYear=2004 | ||
projectScmUrl=scm:[email protected]:apereo/cas.git | ||
|
@@ -339,7 +339,7 @@ openidVersion=1.0.0 | |
############################### | ||
# Tomcat versions | ||
############################### | ||
tomcatVersion=9.0.68 | ||
tomcatVersion=9.0.70 | ||
############################### | ||
# SCIM versions | ||
############################### | ||
|
Oops, something went wrong.