-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee7165d
commit 9b665dd
Showing
8 changed files
with
164 additions
and
150 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
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,92 +1,93 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<project xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd' | ||
xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.example</groupId> | ||
<artifactId>spring-boot-sandbox-parent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath>../</relativePath> | ||
</parent> | ||
<artifactId>custom-logging</artifactId> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-jdbc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-security</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-thymeleaf</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-validation</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.session</groupId> | ||
<artifactId>spring-session-jdbc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-access</artifactId> | ||
</dependency> | ||
<project | ||
xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd' | ||
xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.example</groupId> | ||
<artifactId>spring-boot-sandbox-parent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath>../</relativePath> | ||
</parent> | ||
<artifactId>custom-logging</artifactId> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-jdbc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-security</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-thymeleaf</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-validation</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.session</groupId> | ||
<artifactId>spring-session-jdbc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback.access</groupId> | ||
<artifactId>tomcat</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-configuration-processor</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-devtools</artifactId> | ||
<scope>runtime</scope> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.security</groupId> | ||
<artifactId>spring-security-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-configuration-processor</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-devtools</artifactId> | ||
<scope>runtime</scope> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.security</groupId> | ||
<artifactId>spring-security-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<configuration> | ||
<excludes> | ||
<exclude> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<configuration> | ||
<excludes> | ||
<exclude> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> | ||
</project> |
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
28 changes: 14 additions & 14 deletions
28
custom-logging/src/main/java/com/example/common/accesslog/KeepingNameConverter.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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
package com.example.common.accesslog; | ||
|
||
import ch.qos.logback.access.pattern.AccessConverter; | ||
import ch.qos.logback.access.spi.IAccessEvent; | ||
import ch.qos.logback.access.common.pattern.AccessConverter; | ||
import ch.qos.logback.access.common.spi.IAccessEvent; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
|
||
public class KeepingNameConverter extends AccessConverter { | ||
|
||
static final String REQUEST_ATTRIBUTE_NAME = KeepingNameConverter.class.getName(); | ||
static final String REQUEST_ATTRIBUTE_NAME = KeepingNameConverter.class.getName(); | ||
|
||
@Override | ||
public String convert(IAccessEvent event) { | ||
HttpServletRequest request = event.getRequest(); | ||
if (request != null) { | ||
Object value = request.getAttribute(REQUEST_ATTRIBUTE_NAME); | ||
if (value instanceof String) { | ||
return (String) value; | ||
} | ||
} | ||
return IAccessEvent.NA; | ||
} | ||
@Override | ||
public String convert(IAccessEvent event) { | ||
HttpServletRequest request = event.getRequest(); | ||
if (request != null) { | ||
Object value = request.getAttribute(REQUEST_ATTRIBUTE_NAME); | ||
if (value instanceof String) { | ||
return (String) value; | ||
} | ||
} | ||
return IAccessEvent.NA; | ||
} | ||
} |
28 changes: 14 additions & 14 deletions
28
custom-logging/src/main/java/com/example/common/accesslog/SessionIdConverter.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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
package com.example.common.accesslog; | ||
|
||
import ch.qos.logback.access.pattern.AccessConverter; | ||
import ch.qos.logback.access.spi.IAccessEvent; | ||
import ch.qos.logback.access.common.pattern.AccessConverter; | ||
import ch.qos.logback.access.common.spi.IAccessEvent; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
|
||
public class SessionIdConverter extends AccessConverter { | ||
|
||
static final String REQUEST_ATTRIBUTE_NAME = SessionIdConverter.class.getName(); | ||
static final String REQUEST_ATTRIBUTE_NAME = SessionIdConverter.class.getName(); | ||
|
||
@Override | ||
public String convert(IAccessEvent event) { | ||
HttpServletRequest request = event.getRequest(); | ||
if (request != null) { | ||
Object value = request.getAttribute(REQUEST_ATTRIBUTE_NAME); | ||
if (value instanceof String) { | ||
return (String) value; | ||
} | ||
} | ||
return IAccessEvent.NA; | ||
} | ||
@Override | ||
public String convert(IAccessEvent event) { | ||
HttpServletRequest request = event.getRequest(); | ||
if (request != null) { | ||
Object value = request.getAttribute(REQUEST_ATTRIBUTE_NAME); | ||
if (value instanceof String) { | ||
return (String) value; | ||
} | ||
} | ||
return IAccessEvent.NA; | ||
} | ||
} |
28 changes: 14 additions & 14 deletions
28
custom-logging/src/main/java/com/example/common/accesslog/UserNameConverter.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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
package com.example.common.accesslog; | ||
|
||
import ch.qos.logback.access.pattern.AccessConverter; | ||
import ch.qos.logback.access.spi.IAccessEvent; | ||
import ch.qos.logback.access.common.pattern.AccessConverter; | ||
import ch.qos.logback.access.common.spi.IAccessEvent; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
|
||
public class UserNameConverter extends AccessConverter { | ||
|
||
static final String REQUEST_ATTRIBUTE_NAME = UserNameConverter.class.getName(); | ||
static final String REQUEST_ATTRIBUTE_NAME = UserNameConverter.class.getName(); | ||
|
||
@Override | ||
public String convert(IAccessEvent event) { | ||
HttpServletRequest request = event.getRequest(); | ||
if (request != null) { | ||
Object value = request.getAttribute(REQUEST_ATTRIBUTE_NAME); | ||
if (value instanceof String) { | ||
return (String) value; | ||
} | ||
} | ||
return IAccessEvent.NA; | ||
} | ||
@Override | ||
public String convert(IAccessEvent event) { | ||
HttpServletRequest request = event.getRequest(); | ||
if (request != null) { | ||
Object value = request.getAttribute(REQUEST_ATTRIBUTE_NAME); | ||
if (value instanceof String) { | ||
return (String) value; | ||
} | ||
} | ||
return IAccessEvent.NA; | ||
} | ||
} |
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
Oops, something went wrong.