-
Notifications
You must be signed in to change notification settings - Fork 981
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
Introduce LoggingMarkers marker for logging sensitive data #2051
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8607a39
Introduce PII marker for logging sensitive data
62bdee2
Set Java version dynamically and configure Kotlin compiler
25fccd8
Fix log assertion in BeanOutputConverterTest to use Java 17
80d7e06
Use placeholders in logger.error to prevent string concatenation.
ef96d7b
Update logging markers and improve data classification
db16733
Fix punctuation in Javadoc comments for LoggingMarkers.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
69 changes: 69 additions & 0 deletions
69
spring-ai-core/src/main/java/org/springframework/ai/util/LoggingMarkers.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,69 @@ | ||
package org.springframework.ai.util; | ||
|
||
import org.slf4j.Marker; | ||
import org.slf4j.MarkerFactory; | ||
|
||
/** | ||
* Utility class that provides predefined SLF4J {@link Marker} instances used in logging | ||
* operations within the application. <br> | ||
* This class is not intended to be instantiated, but is open for extension. | ||
*/ | ||
public class LoggingMarkers { | ||
|
||
/** | ||
* Marker used to identify log statements associated with <strong>sensitive | ||
* data</strong>, such as: | ||
* <ul> | ||
* <li>Internal business information</li> | ||
* <li>Employee data</li> | ||
* <li>Customer non-regulated data</li> | ||
* <li>Business processes and logic</li> | ||
* <li>etc.</li> | ||
* </ul> | ||
* Typically, logging this information should be avoided. | ||
*/ | ||
public static final Marker SENSITIVE_DATA_MARKER = MarkerFactory.getMarker("SENSITIVE"); | ||
|
||
/** | ||
* Marker used to identify log statements associated with <strong>restricted | ||
* data</strong>, such as: | ||
* <ul> | ||
* <li>Authentication credentials</li> | ||
* <li>Keys and secrets</li> | ||
* <li>Core intellectual property</li> | ||
* <li>Critical security configs</li> | ||
* <li>Trade secrets</li> | ||
* <li>etc.</li> | ||
* </ul> | ||
* Logging of such information is usually prohibited in any circumstances. | ||
*/ | ||
public static final Marker RESTRICTED_DATA_MARKER = MarkerFactory.getMarker("RESTRICTED"); | ||
|
||
/** | ||
* Marker used to identify log statements associated with <strong>regulated | ||
* data</strong>, such as: | ||
* <ul> | ||
* <li>PCI (credit card data)</li> | ||
* <li>PHI (health information)</li> | ||
* <li>PII (personally identifiable info)</li> | ||
* <li>Financial records</li> | ||
* <li>Compliance-controlled data</li> | ||
* <li>etc.</li> | ||
* </ul> | ||
* Logging of such information should be avoided. | ||
*/ | ||
public static final Marker REGULATED_DATA_MARKER = MarkerFactory.getMarker("REGULATED"); | ||
|
||
/** | ||
* Marker used to identify log statements associated with <strong>public | ||
* data</strong>, such as: | ||
* <ul> | ||
* <li>Public documentation</li> | ||
* <li>Marketing materials</li> | ||
* <li>etc.</li> | ||
* </ul> | ||
* There are no restriction for logging such information. | ||
*/ | ||
public static final Marker PUBLIC_DATA_MARKER = MarkerFactory.getMarker("PUBLIC"); | ||
|
||
} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to add copywrite statement. will add it when merging.