I am trying to find the logs about all the SQL queries that run when a DQL is executed. If I try to execute this from the API tester it works, and I can see the logs. But the difference is that I run that directly from the remote machine, while here I connect to it from my local machine.
String docbase = props.getProperty("dfc.docbase.name");
String username= props.getProperty("dfc.username");
String password = props.getProperty("dfc.password");
IDfSession session = SessionUtil.getSession(docbase,username,password);
The question is where are the logs when I try to run it from the library. I tried
public static void enable(IDfSession session) throws DfException{
IDfApplySetOptions applyCommand = (IDfApplySetOptions) DfAdminCommand.getCommand(IDfAdminCommand.APPLY_SET_OPTIONS);
applyCommand.setOption("rpctrace");
applyCommand.setValue(true);
applyCommand.execute(session);
}
and
public static boolean enable2(IDfSession session) throws DfException{
IDfCollection coll = null;
try {
coll = session.apply(
null,
"SET_OPTIONS",
new DfList(new String[]{"OPTION", "VALUE", }),
new DfList(new String[]{"S", "B", }),
new DfList(new String[]{"rpctrace", "T", }));
if (coll.next() && coll.hasAttr("result")) {
return coll.getBoolean("result");
}
return false;
} finally {
if (coll !=null) {
coll.close();
}
}
}
Full code
public static void main(String[] args) throws IOException, DfException, FileNotFoundException {
Properties props = new Properties();
props.load(Main.class.getResourceAsStream("/config.properties"));
String docbase = props.getProperty("dfc.docbase.name");
String username= props.getProperty("dfc.username");
String password = props.getProperty("dfc.password");
IDfSession session = SessionUtil.getSession(docbase,username,password);
SessionUtil.enable2(session);