INTSAMPLES-150: Switch to Log4j2
JIRA: https://jira.spring.io/browse/INTSAMPLES-150
This commit is contained in:
committed by
Artem Bilan
parent
68377fedd1
commit
e37904128e
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,8 @@ package org.springframework.integration.samples.rest.service;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.integration.samples.rest.domain.Employee;
|
||||
import org.springframework.integration.samples.rest.domain.EmployeeList;
|
||||
@@ -36,7 +37,7 @@ import org.springframework.stereotype.Service;
|
||||
@Service("employeeSearchService")
|
||||
public class EmployeeSearchService {
|
||||
|
||||
private static Logger logger = Logger.getLogger(EmployeeSearchService.class);
|
||||
private static Log logger = LogFactory.getLog(EmployeeSearchService.class);
|
||||
/**
|
||||
* The API <code>getEmployee()</code> looks up the mapped in coming message header's id param
|
||||
* and fills the return object with the appropriate employee details. The return
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# For JBoss: Avoid to setup Log4J outside $JBOSS_HOME/server/default/deploy/log4j.xml!
|
||||
# For all other servers: Comment out the Log4J listener in web.xml to activate Log4J.
|
||||
log4j.rootLogger=INFO, stdout, logfile
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss.SSS} %-5p [%t][%c] %m%n
|
||||
|
||||
log4j.appender.logfile=org.apache.log4j.RollingFileAppender
|
||||
log4j.appender.logfile.File=${rest-http.root}/WEB-INF/logs/rest-http.log
|
||||
log4j.appender.logfile.MaxFileSize=25MB
|
||||
# Keep three backup files.
|
||||
log4j.appender.logfile.MaxBackupIndex=10
|
||||
# Pattern to output: date priority [category] - message
|
||||
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n
|
||||
|
||||
log4j.logger.org.springframework.ws.client.MessageTracing.sent=TRACE
|
||||
log4j.logger.org.springframework.ws.client.MessageTracing.received=DEBUG
|
||||
log4j.logger.org.springframework.ws.server.MessageTracing=DEBUG
|
||||
|
||||
# the httpclient.wire category provides a trace of all of
|
||||
# httpclient's network communication
|
||||
log4j.category.httpclient.wire=INFO
|
||||
16
intermediate/rest-http/src/main/resources/log4j2.xml
Normal file
16
intermediate/rest-http/src/main/resources/log4j2.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="WARN">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5p [%t][%c] %m%n" />
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="info">
|
||||
<AppenderRef ref="Console" />
|
||||
</Root>
|
||||
<Logger name="org.springframework" level="warn" />
|
||||
<Logger name="org.springframework.integration" level="warn" />
|
||||
<Logger name="org.springframework.integration.samples" level="debug" />
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
Reference in New Issue
Block a user