Dukascopy Support Board http://www.dukascopy.com/swiss/english/forex/jforex/forum/ |
|
How to stop log4j DEBUG outputting http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=49259 |
Page 1 of 1 |
Author: | davydai [ Sun 19 May, 2013, 16:34 ] |
Post subject: | How to stop log4j DEBUG outputting |
The outputting in debug.log: 2013-05-19 23:27:18.451 DEBUG com.dukascopy.transport.client.ClientConnector - [d-ja-jpn-04-a.dukascopy.com/54.249.1.145:443] doHandshake() ... 2013-05-19 23:27:18.451 DEBUG com.dukascopy.transport.common.mina.ssl.DDSTrustManager - Checking server is trusted for certificates chain: ... 2013-05-19 23:27:21.872 DEBUG com.dukascopy.transport.client.ClientProtocolHandler - RECEIVE : {"list_response":[{"a":"0.000374,0.0","b":"0.000373,0.0","i":"BRL/XAU","type":"c .... The configure in log4j.properties: log4j.rootLogger=INFO, systemOut, file, warnErrorFile #Filter for dukascopy logs log4j.category.com.dukascopy=ERROR #Filter for dukascopy transport logs log4j.category.com.dukascopy.transport.client=ERROR com.dukascopy.transport.client.ClientConnector=ERROR com.dukascopy.transport.client.ClientProtocolHandler=ERROR #Filter for mina logs log4j.category.org.apache.mina=ERROR #Output only INFO logs to console log4j.appender.systemOut=org.apache.log4j.ConsoleAppender log4j.appender.systemOut.Threshold=INFO log4j.appender.systemOut.layout=org.apache.log4j.PatternLayout log4j.appender.systemOut.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %c{1} - %m%n #File with all the debug log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.Threshold=DEBUG log4j.appender.file.Append=true log4j.appender.file.Encoding=UTF-8 log4j.appender.file.File=./logs/debug.log log4j.appender.file.MaxBackupIndex=5 log4j.appender.file.MaxFileSize=10MBS log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %c - %m%n #File with warnings and errors only log4j.appender.warnErrorFile=org.apache.log4j.DailyRollingFileAppender log4j.appender.warnErrorFile.Threshold=WARN log4j.appender.warnErrorFile.Append=true log4j.appender.warnErrorFile.Encoding=UTF-8 log4j.appender.warnErrorFile.File=./logs/WarnError.log log4j.appender.warnErrorFile.layout=org.apache.log4j.PatternLayout log4j.appender.warnErrorFile.layout.ConversionPattern=%d{HH:mm:ss.SSS} %-5p %c - %m%n |
Author: | API Support [ Mon 20 May, 2013, 16:11 ] |
Post subject: | Re: How to stop log4j DEBUG outputting |
Make sure you have the configuration file in your build classpath. This is the case for the latest JForex-SDK versions see: https://www.dukascopy.com/wiki/#Use_in_Eclipse https://www.dukascopy.com/wiki/#Use_in_NetBeans |
Author: | tcsabina [ Fri 31 May, 2013, 11:51 ] |
Post subject: | Re: How to stop log4j DEBUG outputting |
Just to extend my knowledge, what is wrong here? The debug.log`s threshold is set to DEBUG, and we can see DEBUG messages in the log. |
Author: | API Support [ Fri 31 May, 2013, 12:19 ] |
Post subject: | Re: How to stop log4j DEBUG outputting |
tcsabina wrote: Just to extend my knowledge, what is wrong here? If you don't want to see the logs and change the levels to ERROR, in order your settings to get applied they have to be contained in the project's classpath. This is ensured when you use the JForex-SDK maven project, which is available in links given above.
|
Author: | scotpip [ Tue 26 Jul, 2016, 14:55 ] |
Post subject: | Re: How to stop log4j DEBUG outputting |
If you want to change the log level for the whole app at runtime, I've found that this works. Not very intuitive, so hope that someone finds it useful. import org.apache.log4j.Category; |
Page 1 of 1 |