Skip to content

Instantly share code, notes, and snippets.

@yanaga
Created February 22, 2012 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanaga/1886535 to your computer and use it in GitHub Desktop.
Save yanaga/1886535 to your computer and use it in GitHub Desktop.
Sample development Spring @configuration bean for log4j
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