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
// Compiled by Igor Shults | |
// Last Updated: July 23, 2020 | |
GRAILS GROOVY SOURCE | |
4.1.0 2.5.14 https://github.com/grails/grails-core/blob/v4.1.0/gradle.properties | |
4.0.4 2.5.6 | |
4.0.3 2.5.6 | |
4.0.2 2.5.6 | |
4.0.1 2.5.6 | |
4.0.0 2.5.6 https://github.com/grails/grails-core/blob/v4.0.0/build.gradle |
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
@Plugin(name = 'logmask', category = 'Converter') | |
@ConverterKeys(['cm']) | |
class LogMaskingConverter extends LogEventPatternConverter { | |
private static final String NAME = 'cm' | |
private static final String JSON_REPLACEMENT_REGEX = "\"\$1\": \"****\"" | |
private static final String JSON_KEYS = ['ssn', 'private', 'creditCard'].join('|') | |
private static final Pattern JSON_PATTERN = Pattern.compile(/"(${JSON_KEYS})": "([^"]+)"/) | |
LogMaskingConverter(String[] options) { | |
super(NAME, NAME) |
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
class LoggingMarkers { | |
static final Marker JSON = MarkerFactory.getMarker('JSON-MASK') | |
static final Marker XML = MarkerFactory.getMarker('XML-MASK') | |
} |
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
# Compiled by Igor Shults | |
# As of version 0.17.x | |
#################################################### | |
# # | |
# Basic Settings # | |
# # | |
#################################################### | |
### Global configuration ### |
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
class LogMaskingConverterSpec extends Specification { | |
@Shared | |
LogMaskingConverter converter | |
void setup() { | |
converter = new LogMaskingConverter() | |
} | |
@Unroll |
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
log.info(LoggingMarkers.JSON, '{"ssn": "1234567890"}') // Will mask | |
log.info('{"ssn": "1234567890"}') // Will NOT mask | |
log.info(LoggingMarkers.XML, '{"ssn": "1234567890"}') // Will try to mask, but probably won't work for this message |
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
<Configuration packages='com.path.to.logging, com.your.other.packages'> | |
<Properties> | |
<Property name="maskingPattern"> | |
%d, level=%p, %cm | |
</Property> | |
</Properties> | |
... | |
</Configuration> |
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
<properties> | |
<log4j.version>2.7</log4j.version> | |
<slf4j.version>1.7.22</slf4j.version> | |
</properties> | |
<dependency> | |
<groupId>org.apache.logging.log4j</groupId> | |
<artifactId>log4j-core</artifactId> | |
<version>${log4j.version}</version> | |
</dependency> |
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
#!/bin/sh | |
usage(){ | |
echo "Usage: `basename $0` [-h] [-r] [-t testOptions] [<directory>...]\n" | |
echo ' -h Show this help message.' | |
echo ' -r Remove the default directories, and only use the ones provided. Without the flag, the provided directories will be appended to the default list.' | |
echo ' -t Options to pass to "grails test-app". Default: none.' | |
echo ' See: http://grails.org/doc/latest/ref/Command%20Line/test-app.html' | |
} | |
# Parse the arguments |
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
server { | |
listen 80; | |
server_name example.com; # Your site | |
rewrite ^ https://$host$request_uri permanent; | |
} | |
server { | |
listen 443 default_server ssl; | |
server_name example.com; # Your site |
NewerOlder