supress some log and add a log

This commit is contained in:
gowthaman 2024-05-10 11:45:49 +05:30
parent 3d20b09464
commit 943f83a33f
3 changed files with 11 additions and 1 deletions

View File

@ -60,6 +60,15 @@ class AppAccessManager : AccessManager {
//if role is allowed, or enforcement is turned off or no roles are explicitly allowed //if role is allowed, or enforcement is turned off or no roles are explicitly allowed
handler.handle(ctx) handler.handle(ctx)
} else { } else {
logger.warn(
"entity - {}, action {}, user roles = {}, allowed = {}, isAllowed? {}, enforce? {}",
entity,
action,
currentRoles(),
allowedRoles,
isAllowed,
appConfig.enforceRoleRestriction()
)
ctx.status(HttpStatus.FORBIDDEN).result("user not allowed to do this") ctx.status(HttpStatus.FORBIDDEN).result("user not allowed to do this")
} }
} }

View File

@ -229,7 +229,7 @@ object Auth {
.gt("refreshExpiresAt", LocalDateTime.now()) .gt("refreshExpiresAt", LocalDateTime.now())
.findList() .findList()
.onEach { .onEach {
logger.warn("valid authToken for ${authUser.userName} is ${it.authToken}") logger.warn("valid authToken for ${authUser.userName} is ${it.authToken.substring(0..10)}")
} }
.firstOrNull { .firstOrNull {
it.authToken.equals(authToken, ignoreCase = true) it.authToken.equals(authToken, ignoreCase = true)

View File

@ -22,6 +22,7 @@
<!-- SQL and bind values --> <!-- SQL and bind values -->
<logger name="io.ebean.SQL" level="WARN"/> <logger name="io.ebean.SQL" level="WARN"/>
<logger name="org.apache.http.client.protocol.ResponseProcessCookies" level="ERROR"/>
<!-- Transaction Commit and Rollback events --> <!-- Transaction Commit and Rollback events -->
<logger name="io.ebean.TXN" level="DEBUG"/> <logger name="io.ebean.TXN" level="DEBUG"/>