Skip to content

Commit b3974d8

Browse files
committed
work
1 parent f864f45 commit b3974d8

37 files changed

+569
-619
lines changed

src/main/java/org/woehlke/simpleworklist/common/error/ApplicationErrorController.java

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.woehlke.simpleworklist.common.error;
22

33

4-
import lombok.extern.slf4j.Slf4j;
4+
import lombok.extern.java.Log;
55
import org.springframework.boot.web.servlet.error.ErrorController;
66
import org.springframework.http.HttpStatus;
77
import org.springframework.stereotype.Controller;
@@ -14,7 +14,7 @@
1414
import static org.springframework.web.bind.annotation.RequestMethod.*;
1515

1616

17-
@Slf4j
17+
@Log
1818
@Controller
1919
@RequestMapping(path="/fehler")
2020
public class ApplicationErrorController implements ErrorController {
@@ -24,76 +24,76 @@ public class ApplicationErrorController implements ErrorController {
2424
public String handleError(
2525
HttpServletRequest request
2626
) {
27-
log.debug("handleError");
27+
log.info("handleError");
2828
String errorMessage = (String) request.getAttribute(ERROR_MESSAGE);
2929
if(errorMessage!=null){
30-
log.warn("errorMessage :"+errorMessage);
30+
log.warning("errorMessage :"+errorMessage);
3131
}
3232
Integer statusCode = (Integer) request.getAttribute(ERROR_STATUS_CODE);
3333
if(statusCode != null){
3434
HttpStatus httpStatus = HttpStatus.valueOf(statusCode);
35-
log.warn(httpStatus.value()+""+httpStatus.getReasonPhrase());
35+
log.warning(httpStatus.value()+""+httpStatus.getReasonPhrase());
3636
switch (httpStatus){
3737
case NOT_FOUND:
38-
log.warn("##################################################");
39-
log.warn(" 404 NOT_FOUND");
40-
log.warn("##################################################");
38+
log.warning("##################################################");
39+
log.warning(" 404 NOT_FOUND");
40+
log.warning("##################################################");
4141
return "error/error-404";
4242
case INTERNAL_SERVER_ERROR:
43-
log.warn("##################################################");
44-
log.warn(" 500 INTERNAL_SERVER_ERROR");
45-
log.warn("##################################################");
43+
log.warning("##################################################");
44+
log.warning(" 500 INTERNAL_SERVER_ERROR");
45+
log.warning("##################################################");
4646
return "error/error-500";
4747
case UNAUTHORIZED:
48-
log.warn("##################################################");
49-
log.warn(" 401 UNAUTHORIZED");
50-
log.warn("##################################################");
48+
log.warning("##################################################");
49+
log.warning(" 401 UNAUTHORIZED");
50+
log.warning("##################################################");
5151
return "redirect:/login?login_error=1";
5252
case METHOD_NOT_ALLOWED:
53-
log.warn("##################################################");
54-
log.warn(" 405 METHOD_NOT_ALLOWED");
55-
log.warn("##################################################");
53+
log.warning("##################################################");
54+
log.warning(" 405 METHOD_NOT_ALLOWED");
55+
log.warning("##################################################");
5656
return "redirect:/login?login_error=1";
5757
case FORBIDDEN:
58-
log.warn("##################################################");
59-
log.warn(" 403 FORBIDDEN");
60-
log.warn("##################################################");
58+
log.warning("##################################################");
59+
log.warning(" 403 FORBIDDEN");
60+
log.warning("##################################################");
6161
return "redirect:/login?login_error=1";
6262
case REQUEST_TIMEOUT:
63-
log.warn("##################################################");
64-
log.warn(" 408 REQUEST_TIMEOUT");
65-
log.warn("##################################################");
63+
log.warning("##################################################");
64+
log.warning(" 408 REQUEST_TIMEOUT");
65+
log.warning("##################################################");
6666
return "redirect:/login?login_error=1";
6767
case CONFLICT:
68-
log.warn("##################################################");
69-
log.warn(" 409 CONFLICT");
70-
log.warn("##################################################");
68+
log.warning("##################################################");
69+
log.warning(" 409 CONFLICT");
70+
log.warning("##################################################");
7171
return "redirect:/login?login_error=1";
7272
case PRECONDITION_FAILED:
73-
log.warn("##################################################");
74-
log.warn(" 412 PRECONDITION_FAILED");
75-
log.warn("##################################################");
73+
log.warning("##################################################");
74+
log.warning(" 412 PRECONDITION_FAILED");
75+
log.warning("##################################################");
7676
return "redirect:/login?login_error=1";
7777
case URI_TOO_LONG:
78-
log.warn("##################################################");
79-
log.warn(" 414 URI_TOO_LONG");
80-
log.warn("##################################################");
78+
log.warning("##################################################");
79+
log.warning(" 414 URI_TOO_LONG");
80+
log.warning("##################################################");
8181
return "redirect:/login?login_error=1";
8282
case UNSUPPORTED_MEDIA_TYPE:
83-
log.warn("##################################################");
84-
log.warn(" 415 UNSUPPORTED_MEDIA_TYPE");
85-
log.warn("##################################################");
83+
log.warning("##################################################");
84+
log.warning(" 415 UNSUPPORTED_MEDIA_TYPE");
85+
log.warning("##################################################");
8686
return "redirect:/login?login_error=1";
8787
}
8888
}
8989
Throwable exception = (Throwable) request.getAttribute(ERROR_EXCEPTION);
9090
if(exception != null) {
91-
log.warn("##################################################");
92-
log.warn("Exception :" + exception.getMessage());
91+
log.warning("##################################################");
92+
log.warning("Exception :" + exception.getMessage());
9393
for (StackTraceElement elem : exception.getStackTrace()) {
94-
log.warn("Stacktrace: " + elem.getFileName() + ":+" + elem.getLineNumber() + " " + elem.getClassName() + "." + elem.getMethodName());
94+
log.warning("Stacktrace: " + elem.getFileName() + ":+" + elem.getLineNumber() + " " + elem.getClassName() + "." + elem.getMethodName());
9595
}
96-
log.warn("##################################################");
96+
log.warning("##################################################");
9797
}
9898
return "error/error";
9999
}

src/main/java/org/woehlke/simpleworklist/common/testdata/TestDataController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.woehlke.simpleworklist.common.testdata;
22

3-
import lombok.extern.slf4j.Slf4j;
3+
import lombok.extern.java.Log;
44
import org.springframework.stereotype.Controller;
55
import org.springframework.web.bind.annotation.RequestMapping;
66
import org.springframework.web.bind.annotation.RequestMethod;
@@ -9,7 +9,7 @@
99
import org.springframework.beans.factory.annotation.Autowired;
1010
import org.woehlke.simpleworklist.user.services.UserAccountLoginSuccessService;
1111

12-
@Slf4j
12+
@Log
1313
@Controller
1414
@RequestMapping(path = "/testdata")
1515
public class TestDataController {

src/main/java/org/woehlke/simpleworklist/common/testdata/TestDataServiceImpl.java

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.woehlke.simpleworklist.common.testdata;
22

3-
import lombok.extern.slf4j.Slf4j;
3+
import lombok.extern.java.Log;
44
import org.springframework.stereotype.Service;
55
import org.springframework.transaction.annotation.Propagation;
66
import org.springframework.transaction.annotation.Transactional;
@@ -19,7 +19,7 @@
1919
import java.util.Date;
2020
import java.util.UUID;
2121

22-
@Slf4j
22+
@Log
2323
@Service
2424
public class TestDataServiceImpl implements TestDataService {
2525

@@ -36,14 +36,14 @@ public TestDataServiceImpl(ProjectRepository projectRepository, TaskRepository t
3636

3737
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
3838
public void createTestCategoryTreeForUserAccount(UserAccount userAccount) {
39-
log.debug("----------------------------------------------");
40-
log.debug("createTestCategoryTreeForUserAccount");
41-
log.debug("----------------------------------------------");
42-
log.debug("userAccount: "+userAccount.toString());
43-
log.debug("----------------------------------------------");
39+
log.info("----------------------------------------------");
40+
log.info("createTestCategoryTreeForUserAccount");
41+
log.info("----------------------------------------------");
42+
log.info("userAccount: "+userAccount.toString());
43+
log.info("----------------------------------------------");
4444
Context contextWork = userAccount.getDefaultContext();
45-
log.debug("contextWork: "+contextWork.toString());
46-
log.debug("----------------------------------------------");
45+
log.info("contextWork: "+contextWork.toString());
46+
log.info("----------------------------------------------");
4747
Date nowDate = new Date();
4848
long now = nowDate.getTime();
4949
String name01 = "test01_" + now;
@@ -68,10 +68,10 @@ public void createTestCategoryTreeForUserAccount(UserAccount userAccount) {
6868
c02.setDescription("description02 for " + name02 + " " + loremIpsumProject);
6969
c01 = projectRepository.saveAndFlush(c01);
7070
c02 = projectRepository.saveAndFlush(c02);
71-
log.debug("----------------------------------------------");
72-
log.debug("persisted: "+ c01.toString());
73-
log.debug("persisted: "+ c02.toString());
74-
log.debug("----------------------------------------------");
71+
log.info("----------------------------------------------");
72+
log.info("persisted: "+ c01.toString());
73+
log.info("persisted: "+ c02.toString());
74+
log.info("----------------------------------------------");
7575
Project c0101 = Project.newProjectFactoryForParentProject(c01);
7676
Project c0102 = Project.newProjectFactoryForParentProject(c01);
7777
Project c0201 = Project.newProjectFactoryForParentProject(c02);
@@ -96,12 +96,12 @@ public void createTestCategoryTreeForUserAccount(UserAccount userAccount) {
9696
c0102 = projectRepository.saveAndFlush(c0102);
9797
c0201 = projectRepository.saveAndFlush(c0201);
9898
c0202 = projectRepository.saveAndFlush(c0202);
99-
log.debug("----------------------------------------------");
100-
log.debug("persisted: "+ c0101.toString());
101-
log.debug("persisted: "+ c0102.toString());
102-
log.debug("persisted: "+ c0201.toString());
103-
log.debug("persisted: "+ c0202.toString());
104-
log.debug("----------------------------------------------");
99+
log.info("----------------------------------------------");
100+
log.info("persisted: "+ c0101.toString());
101+
log.info("persisted: "+ c0102.toString());
102+
log.info("persisted: "+ c0201.toString());
103+
log.info("persisted: "+ c0202.toString());
104+
log.info("----------------------------------------------");
105105
Project c020201 = Project.newProjectFactoryForParentProject(c0202);
106106
Project c020202 = Project.newProjectFactoryForParentProject(c0202);
107107
Project c020203 = Project.newProjectFactoryForParentProject(c0202);
@@ -120,12 +120,12 @@ public void createTestCategoryTreeForUserAccount(UserAccount userAccount) {
120120
c020201 = projectRepository.saveAndFlush(c020201);
121121
c020202 = projectRepository.saveAndFlush(c020202);
122122
c020203 = projectRepository.saveAndFlush(c020203);
123-
log.debug("----------------------------------------------");
124-
log.debug("persisted: "+ c020201.toString());
125-
log.debug("persisted: "+ c020202.toString());
126-
log.debug("persisted: "+ c020202.toString());
127-
log.debug("persisted: "+ c020203.toString());
128-
log.debug("----------------------------------------------");
123+
log.info("----------------------------------------------");
124+
log.info("persisted: "+ c020201.toString());
125+
log.info("persisted: "+ c020202.toString());
126+
log.info("persisted: "+ c020202.toString());
127+
log.info("persisted: "+ c020203.toString());
128+
log.info("----------------------------------------------");
129129
Project c02020301 = Project.newProjectFactoryForParentProject(c020203);
130130
Project c02020302 = Project.newProjectFactoryForParentProject(c020203);
131131
Project c02020303 = Project.newProjectFactoryForParentProject(c020203);
@@ -144,11 +144,11 @@ public void createTestCategoryTreeForUserAccount(UserAccount userAccount) {
144144
c02020301 = projectRepository.saveAndFlush(c02020301);
145145
c02020302 = projectRepository.saveAndFlush(c02020302);
146146
c02020303 = projectRepository.saveAndFlush(c02020303);
147-
log.debug("----------------------------------------------");
148-
log.debug("persisted: "+ c02020301.toString());
149-
log.debug("persisted: "+ c02020302.toString());
150-
log.debug("persisted: "+ c02020303.toString());
151-
log.debug("----------------------------------------------");
147+
log.info("----------------------------------------------");
148+
log.info("persisted: "+ c02020301.toString());
149+
log.info("persisted: "+ c02020302.toString());
150+
log.info("persisted: "+ c02020303.toString());
151+
log.info("----------------------------------------------");
152152
/* add 100 Tasks with Project c02020303 */
153153
for (int i = 10; i < 111; i++) {
154154
String title = "title_" + i;
@@ -166,11 +166,11 @@ public void createTestCategoryTreeForUserAccount(UserAccount userAccount) {
166166
task.setOrderIdProject(i);
167167
task.setOrderIdTaskState(i);
168168
taskRepository.saveAndFlush(task);
169-
log.debug("----------------------------------------------");
170-
log.debug("persisted: "+ task.toString());
171-
log.debug("----------------------------------------------");
169+
log.info("----------------------------------------------");
170+
log.info("persisted: "+ task.toString());
171+
log.info("----------------------------------------------");
172172
}
173-
log.debug("----------------------------------------------");
173+
log.info("----------------------------------------------");
174174
/* add 20 Tasks with Project Root */
175175
for (int i = 10; i <30; i++) {
176176
String title = "title_" + i;
@@ -188,9 +188,9 @@ public void createTestCategoryTreeForUserAccount(UserAccount userAccount) {
188188
task.setOrderIdProject(i);
189189
task.setOrderIdTaskState(i+111);
190190
taskRepository.saveAndFlush(task);
191-
log.debug("----------------------------------------------");
192-
log.debug("persisted: "+ task.toString());
193-
log.debug("----------------------------------------------");
191+
log.info("----------------------------------------------");
192+
log.info("persisted: "+ task.toString());
193+
log.info("----------------------------------------------");
194194
}
195195
}
196196

0 commit comments

Comments
 (0)