Skip to content

Commit

Permalink
Merge pull request #52 from cedadev/fix-log4j
Browse files Browse the repository at this point in the history
Fix log4j
  • Loading branch information
LucaCinquini committed Nov 25, 2014
2 parents 375f3aa + c95e2a4 commit 82e0287
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
16 changes: 10 additions & 6 deletions etc/conf/esg-search-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
<!-- Log4j configuration -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.xml</param-value>
</context-param>
<context-param>
<param-name>log4jExposeWebAppRoot</param-name>
<param-value>true</param-value>
<param-value>/WEB-INF/classes/log4j.xml</param-value>
</context-param>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>esg-search.root</param-value>
</context-param>

<!-- Spring Security filter chain -->
<filter>
Expand Down Expand Up @@ -83,10 +83,14 @@
<param-value>classpath:esg/search/config/web-application-context.xml</param-value>
</context-param>

<!-- Listener that allows Log4J configuration from the specified context parameter -->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!-- Listener that loads the Spring web application context
(from the specified value of contextConfigLocation) -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

</web-app>
</web-app>
16 changes: 14 additions & 2 deletions src/java/main/log4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@
</layout>
</appender>

<appender name="search_log" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${catalina.base}/logs/esgf-search.log"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- TODO: add datetime? -->
<param name="conversionPattern" value="%d [%p] %C: %m %n"/>
</layout>
</appender>
<logger name="esg" additivity="false">
<level value="DEBUG" />
<level value="INFO" />
<appender-ref ref="stdout" />
</logger>

Expand All @@ -40,7 +47,12 @@

<logger name="org.apache.solr" additivity="false">
<level value="INFO" />
<appender-ref ref="stdout" />
<appender-ref ref="search_log" />
</logger>
<logger name="esg.search" addiitivity="false">
<level value="INFO" />
<appender-ref ref="search_log" />
</logger>


</log4j:configuration>

0 comments on commit 82e0287

Please sign in to comment.