Transact

⌘K
  1. Home
  2. Transact
  3. Developer Documentation
  4. Scripting Resources
  5. Enabling Logging Custom Scripts

Enabling Logging Custom Scripts

How to enable logging in a custom jar file

Topic : Ephesoft has a built in logging functionality. When setting System.out.println in the scripts, Ephesoft doesn’t have any control over printing these statements and will always print them to the logs which can cause the logs to grow large very quickly. By using the built in log4j logger, the scripts will only print to the logs based on the logging level specified in the log4j.xml file. You will need to replace the messages to match your specific logging alerts.

Applicable Ephesoft versions:

All Versions

 

Instructions:

  1. When creating your custom script, it is advisable to use the sample below for creating logs for the script to print to the stdout and dcma-all log files.

[code]public Object execute(Document document, String methodName, String docIdentifier) {
Exception exception = null;
try {
LOGGER.info(“************* Inside ExportScript scripts.”);

LOGGER.info(“************* Start execution of the ExportScript scripts.”);

if (null == document) {
LOGGER.error(“Input document is null.”);
return null;
}
LOGGER.info(“************* End execution of the ScriptExport scripts.”);
} catch (Exception e) {
LOGGER.error(“************* Error occurred in scripts.” + e.getMessage());
exception = e;
}
return null;
}[/code]