Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-demo-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gic_demo
gic-demo-project
Commits
d284646f
Commit
d284646f
authored
Jul 12, 2019
by
朱瑞泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
强制使用log4j2输出日志
parent
fccd54e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
DemoProjectController.java
...ic/demo/project/web/controller/DemoProjectController.java
+3
-3
GlobalExceptionHandler.java
...ic/demo/project/web/exception/GlobalExceptionHandler.java
+4
-3
No files found.
gic-demo-project-web/src/main/java/com/gic/demo/project/web/controller/DemoProjectController.java
View file @
d284646f
...
...
@@ -8,8 +8,8 @@ import com.gic.demo.project.api.service.DemoStoreApiService;
import
com.gic.demo.project.web.exception.GicDemoErrCode
;
import
com.gic.demo.project.web.vo.DemoStoreVO
;
import
org.apache.commons.lang.StringUtils
;
import
org.
slf4j.Log
ger
;
import
org.
slf4j.LoggerFactory
;
import
org.
apache.logging.log4j.LogMana
ger
;
import
org.
apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
"/demo"
)
public
class
DemoProjectController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DemoProjectController
.
class
);
private
final
Logger
logger
=
LogManager
.
getLogger
(
DemoProjectController
.
class
);
@Autowired
private
DemoStoreApiService
demoStoreApiService
;
...
...
gic-demo-project-web/src/main/java/com/gic/demo/project/web/exception/GlobalExceptionHandler.java
View file @
d284646f
package
com
.
gic
.
demo
.
project
.
web
.
exception
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
org.
slf4j.Log
ger
;
import
org.
slf4j.LoggerFactory
;
import
org.
apache.logging.log4j.LogMana
ger
;
import
org.
apache.logging.log4j.Logger
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
...
...
@@ -18,7 +18,8 @@ import java.io.PrintWriter;
*/
@ControllerAdvice
public
class
GlobalExceptionHandler
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
GlobalExceptionHandler
.
class
);
private
final
Logger
logger
=
LogManager
.
getLogger
(
GlobalExceptionHandler
.
class
);
@ResponseBody
@ExceptionHandler
(
Exception
.
class
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment