Skip to content

Instantly share code, notes, and snippets.

View akerekes's full-sized avatar

Andras Kerekes akerekes

  • Google
  • Seattle, WA
View GitHub Profile
@akerekes
akerekes / jboss-deployment-structure.xml
Created September 18, 2013 02:44
JBoss deployment structure file to disable container provided logging
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.slf4j"/>
<module name="org.slf4j.impl"/>
<module name="org.jboss.logging"/>
<module name="org.apache.commons.logging"/>
<module name="org.jboss.logging.jul-to-slf4j-stub"/>
@akerekes
akerekes / web.xml
Last active December 23, 2015 07:49
Log4J initialization with custom servlet listener
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="oasis-web" version="2.5">
<display-name>oasis-web</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>applicationContext.xml</param-value>
@akerekes
akerekes / SystemPropertyLog4jConfigurer.java
Created September 17, 2013 12:01
Extension to Spring's Log4jConfigListener that uses log4j.configuration system property to read the log4j configuration from. If not specified falls back to the Spring's original behavior
package hu.ka.log4j;
import org.springframework.util.Log4jConfigurer;
import org.springframework.web.util.Log4jConfigListener;
import javax.servlet.ServletContextEvent;
import java.io.FileNotFoundException;
public class SystemPropertyLog4jConfigurer extends Log4jConfigListener {