Skip to content

Commit 1ad723f

Browse files
committed
Changed warning messages when trying to access the session to debug to avoid cluttering CloudWatch logs when used with Spring
1 parent 62d9600 commit 1ad723f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/servlet/AwsHttpServletRequest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public String getRequestedSessionId() {
107107

108108
@Override
109109
public HttpSession getSession(boolean b) {
110-
log.warn("Trying to access session. Lambda functions are stateless and should not rely on the session");
110+
log.debug("Trying to access session. Lambda functions are stateless and should not rely on the session");
111111
if (b && null == this.session) {
112112
ApiGatewayRequestContext requestContext = (ApiGatewayRequestContext) getAttribute(RequestReader.API_GATEWAY_CONTEXT_PROPERTY);
113113
this.session = new AwsHttpSession(requestContext.getRequestId());
@@ -118,43 +118,43 @@ public HttpSession getSession(boolean b) {
118118

119119
@Override
120120
public HttpSession getSession() {
121-
log.warn("Trying to access session. Lambda functions are stateless and should not rely on the session");
121+
log.debug("Trying to access session. Lambda functions are stateless and should not rely on the session");
122122
return this.session;
123123
}
124124

125125

126126
@Override
127127
public String changeSessionId() {
128-
log.warn("Trying to access session. Lambda functions are stateless and should not rely on the session");
128+
log.debug("Trying to access session. Lambda functions are stateless and should not rely on the session");
129129
return null;
130130
}
131131

132132

133133
@Override
134134
public boolean isRequestedSessionIdValid() {
135-
log.warn("Trying to access session. Lambda functions are stateless and should not rely on the session");
135+
log.debug("Trying to access session. Lambda functions are stateless and should not rely on the session");
136136
return false;
137137
}
138138

139139

140140
@Override
141141
public boolean isRequestedSessionIdFromCookie() {
142-
log.warn("Trying to access session. Lambda functions are stateless and should not rely on the session");
142+
log.debug("Trying to access session. Lambda functions are stateless and should not rely on the session");
143143
return false;
144144
}
145145

146146

147147
@Override
148148
public boolean isRequestedSessionIdFromURL() {
149-
log.warn("Trying to access session. Lambda functions are stateless and should not rely on the session");
149+
log.debug("Trying to access session. Lambda functions are stateless and should not rely on the session");
150150
return false;
151151
}
152152

153153

154154
@Override
155155
@Deprecated
156156
public boolean isRequestedSessionIdFromUrl() {
157-
log.warn("Trying to access session. Lambda functions are stateless and should not rely on the session");
157+
log.debug("Trying to access session. Lambda functions are stateless and should not rely on the session");
158158
return false;
159159
}
160160

0 commit comments

Comments
 (0)