Skip to main content
Common Reference

Logging Information and Exceptions

Information about the filtering process can be reported into the standard trepsvc.log file by using the logger object. This supports different methods according to the configured logging level:

  • logger.info() — information level entry, used to indicate configuration, loading or progress.
  • logger.debug() — information will be logged when debugging is enabled, used when showing progress during development.
  • logger.error() — used to log an error that would cause a problem or replication to stop.

For example, to log an informational entry that includes data from the filter process:

logger.info("regexp: Translating string " + valueString.valueOf());

To raise an exception that causes replication to stop, a new ReplicatorException object must be created that contains the error message:

if(col == null)
{
throw new com.continuent.tungsten.replicator.ReplicatorException(
"dropcolumn.js: column name in " + schema + "." + table +
" is undefined - is colnames filter enabled and is it before the dropcolumn filter?"
);
}

The error string provided will be used as the error provided through trepctl, in addition to raising an exception and backtrace within the log.