Created
February 22, 2012 18:33
-
-
Save yanaga/1886535 to your computer and use it in GitHub Desktop.
Sample development Spring @configuration bean for log4j
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.FileNotFoundException; | |
import javax.annotation.PostConstruct; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.util.Log4jConfigurer; | |
@Configuration | |
@Profile("development") | |
public class ConsoleLog4jConfig { | |
@PostConstruct | |
public void initLog4j() throws FileNotFoundException { | |
Log4jConfigurer.initLogging("classpath:log4j.properties"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment