Skip to content

Commit 3c76d11

Browse files
author
eugenp
committed
logging work
1 parent 92d28cd commit 3c76d11

7 files changed

Lines changed: 44 additions & 85 deletions

File tree

‎spring-security-login-and-registration/src/main/resources/email.properties‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ smtp.host=email-smtp.us-east-1.amazonaws.com
33
smtp.port=465
44
smtp.protocol=smtps
55
smtp.username=AKIAJIKXZAQFFJDXI4VQ
6-
smtp.password=
7-
support.email=xxx777@gmail.com
6+
smtp.password=AjYQNjXVTalbpfRL37RYqyXEkyQAvmKFcUFQllfAsBLh
7+
support.email=eugen@baeldung.com

‎spring-security-login-and-registration/src/main/resources/messages_en.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ auth.message.blocked=This ip is blocked for 24 hours
6363
message.accountVerified=Your account verified successfully
6464
message.resetPasswordSuc=Password reset successfully
6565
message.resetYourPassword=Reset your password
66-
message.resetPasswordEmail=We will send an email to reset your password
66+
message.resetPasswordEmail=You should receive an Password Reset Email shortly

‎spring-security-oauth/src/main/java/org/baeldung/config/ServletInitializer.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ protected WebApplicationContext createRootApplicationContext() {
3030
@Override
3131
public void onStartup(ServletContext servletContext) throws ServletException {
3232
super.onStartup(servletContext);
33+
34+
servletContext.addListener(new SessionListener());
35+
3336
registerProxyFilter(servletContext, "oauth2ClientContextFilter");
3437
}
3538

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.baeldung.config;
2+
3+
import javax.servlet.http.HttpSessionEvent;
4+
import javax.servlet.http.HttpSessionListener;
5+
6+
public class SessionListener implements HttpSessionListener {
7+
8+
@Override
9+
public void sessionCreated(HttpSessionEvent event) {
10+
System.out.println("==== Session is created ====");
11+
event.getSession().setMaxInactiveInterval(1 * 60);
12+
}
13+
14+
@Override
15+
public void sessionDestroyed(HttpSessionEvent event) {
16+
System.out.println("==== Session is destroyed ====");
17+
}
18+
}

‎spring-security-oauth/src/main/resources/log4j.xml‎

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<configuration>
2+
3+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
4+
<encoder>
5+
<pattern>web - %date [%thread] %-5level %logger{36} - %message%n
6+
</pattern>
7+
</encoder>
8+
</appender>
9+
10+
<logger name="org.springframework" level="WARN" />
11+
<logger name="org.springframework.transaction" level="WARN" />
12+
13+
<!-- in order to debug some marshalling issues, this needs to be TRACE -->
14+
<logger name="org.springframework.web.servlet.mvc" level="WARN" />
15+
16+
<root level="INFO">
17+
<appender-ref ref="STDOUT" />
18+
</root>
19+
20+
</configuration>

‎spring-security-oauth/src/test/resources/log4j.xml‎

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)