sifting-appender

accessing multiple values in MDC with siftingappender or gsiftingappender

£可爱£侵袭症+ 提交于 2019-12-11 11:59:53
问题 I have a siftingappender that i use for a key in mdc to customize the file appenders. The problem is i cannot access multiple values from the configuration. Is there a way to access 2 or more keys that exists in MDC? 回答1: I had the same problem, and looking at the class it appeared it wasn't possible to use two discriminator keys. The solution I used was then to set a property containing the combination of this values at the beginning of the "session" : String value1 = "a variable"; String

Cannot find the log4j siftAppender output logs

偶尔善良 提交于 2019-12-10 23:55:24
问题 I followed this tutorial I have this code, but no log file was written. What am i missing? here is my code: https://github.com/elad2109/log4j_sift/blob/master/src/main/java/com/waze/rr_logger/SiftExampleLog4j.java import org.apache.log4j.Logger; import org.slf4j.LoggerFactory; public class SiftExampleLog4j { static org.apache.log4j.Logger logger = Logger.getLogger(SiftExampleLog4j.class); public void log() { BasicConfigurator.configure(); org.apache.log4j.MDC.put("session_id","MyGooApp");