[D7.2 JMS] location of custom job logs run by JMS
seloum57
Member
Hello,
I developed a custom java method which is executed by the Java Method Server (D7.2), and when I launch the job I created, the execution logs are only on the server.log of the jboss, the file which is created in /Temp/Jobs/<my_job_name> is empty; how to log into this file (as Documentum-native jobs). ?
Please note that I'm using System.out.println for logging in my custom job
Tagged:
0
Best Answer
-
Hi,
When you are implementing the method public int execute(Map map, PrintWriter printwriter) throws Exception, use the printWriter argument instead of the System.out.
Example :
package test;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Map;
import com.documentum.fc.methodserver.IDfMethod;
import com.documentum.mthdservlet.IDmMethod;
public class MyTestMethod implements IDfMethod, IDmMethod {
private PrintWriter printWriter;
protected void println(String string) {
this.printWriter.println(string);
}
@Override
public void execute(Map arg0, OutputStream arg1) throws Exception {
PrintWriter printWriter = new PrintWriter(arg1);
try {
execute(arg0, printWriter);
} finally {
printWriter.close();
}
}
@Override
public int execute(Map map, PrintWriter printwriter) throws Exception {
this.printWriter = new PrintWriter(printwriter, true);
try {
println("This is my log");
} finally {
this.printWriter.close();
}
return 0;
}
}0
Answers
-
Hi,
When you are implementing the method public int execute(Map map, PrintWriter printwriter) throws Exception, use the printWriter argument instead of the System.out.
Example :
package test;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Map;
import com.documentum.fc.methodserver.IDfMethod;
import com.documentum.mthdservlet.IDmMethod;
public class MyTestMethod implements IDfMethod, IDmMethod {
private PrintWriter printWriter;
protected void println(String string) {
this.printWriter.println(string);
}
@Override
public void execute(Map arg0, OutputStream arg1) throws Exception {
PrintWriter printWriter = new PrintWriter(arg1);
try {
execute(arg0, printWriter);
} finally {
printWriter.close();
}
}
@Override
public int execute(Map map, PrintWriter printwriter) throws Exception {
this.printWriter = new PrintWriter(printwriter, true);
try {
println("This is my log");
} finally {
this.printWriter.close();
}
return 0;
}
}0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 150 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories