Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
gateway
Commits
06cdccc2
Commit
06cdccc2
authored
1 year ago
by
shishir suman
Browse files
Options
Download
Patches
Plain Diff
adding prefilter for logging requests
parent
bc03c00a
uat
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/upsmf/gateway/filter/pre/CommonPreFilter.java
+31
-0
...in/java/com/upsmf/gateway/filter/pre/CommonPreFilter.java
with
31 additions
and
0 deletions
+31
-0
src/main/java/com/upsmf/gateway/filter/pre/CommonPreFilter.java
0 → 100644
+
31
−
0
View file @
06cdccc2
package
com.upsmf.gateway.filter.pre
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.gateway.filter.GatewayFilterChain
;
import
org.springframework.cloud.gateway.filter.GlobalFilter
;
import
org.springframework.core.Ordered
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.server.ServerWebExchange
;
import
reactor.core.publisher.Mono
;
@Slf4j
@Component
public
class
CommonPreFilter
implements
GlobalFilter
,
Ordered
{
@Override
public
Mono
<
Void
>
filter
(
ServerWebExchange
exchange
,
GatewayFilterChain
chain
)
{
log
.
debug
(
"Global Pre Filter executed || Request - {} "
,
exchange
.
getRequest
());
log
.
debug
(
"Global Pre Filter executed || Request Headers - {} "
,
exchange
.
getRequest
().
getHeaders
());
log
.
info
(
"Global Pre Filter executed || Path - {} "
,
exchange
.
getRequest
().
getPath
().
value
());
return
chain
.
filter
(
exchange
);
}
@Override
public
int
getOrder
()
{
return
-
1
;
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets