Consider the following startegy for testing slf4j logging to the JForex client java console:
package jforex.logging;
import com.dukascopy.api.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@RequiresFullAccess
@Library("C:/temp/log4j-over-slf4j-1.6.1.jar;C:/temp/slf4j-api-1.6.1.jar")
public class LoggingTests implements IStrategy {
public void onStart(IContext context) throws JFException {
Logger logger = LoggerFactory.getLogger(LoggingTests.class);
logger.info("log test");
}
public void onTick(Instrument instrument, ITick tick) throws JFException {}
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
public void onMessage(IMessage message) throws JFException {}
public void onAccount(IAccount account) throws JFException {}
public void onStop() throws JFException {}
}
Make sure to have the appropriate jars in your file system and to have them referenced from the strategy.