I am using log4j for logging. I have a scenario where I have to use seperate logging for different severity. For example, for package foo I have to print messages with severity ERROR in the console whereas I have to print messages with severity WARN in log file. How can I configure my log4j.xml for the same.
相关问题
- convert logback.xml to log4j.properties
- logging static methods in a parent class
- Wrap log4j or create custom logger?
- ClassNotFoundException found in Log4j 2.0
- Undeploying a Grails App from Glassfish gets a Cla
相关文章
- Can IntelliJ create hyperlinks to the source code
- how can I disable output to log4j.rootLogger?
- Log4j2 using {} against using %d or %s
- How do I redirect a javaw.exe console output to a
- log4j: Standard way to prevent repetitive log mess
- Log4j2 not working in WebLogic 12.2.1
- Grails and Log4J : How to logs in different files
- Managing a Large Number of Log Files Distributed O
You may use LevelMatchFilter for your task. Also you should not forget to use another filter - DenyAllFilter - as the last filter in the chain of filters.
Your log4j.xml will look like this: