Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom logging in a rule/workflow step

Custom logging in a rule/workflow step

Oftentimes, it's difficult to figure out which SailPoint class to enable logging on when debugging a rule.


Plus turning on logging for a connector in order to debug a rule, has the added effect of turning on all other logging

statements for the connector as well which can make it difficult to isolate the log statements for your rule.


Here is a trick to do your own per-rule custom logging:


1. Make sure to import the apache log4j Logger object

import org.apache.log4j.Logger;

2. Create a custom logger in your rule or workflow code:

Logger  mylogger = Logger.getLogger("com.yourcompany.projectname.FinanceCorrelationRule ");

3. Use this logger object for all your logging in the rule:

mylogger.debug("This is a debug message");"This is an info message");

4. Using your file, control logging per rule by enabling or disabling logging: =<loglevel>

Labels (2)

Glad to hear.  It's been working well for us so far.  It's nice to be able to focus in on a specific step and/or look at things at a higher level without having to do anything crazy implementation wise.


Please ignore my above question as I checked my file and found that somehow I had removed the logger defined for the Rule I mentioned above. That was the reason it wasn't logging.


Will this work in 7.2p2?

I am getting No Serializer registered for class

An unexpected error occurred: No serializer registered for class class org.apache.log4j.Logger No serializer registered for class class org.apache.log4j.Logger









Are you backgrounding your workflow (i.e. is it stopping because of a background step, wait step or because you are filling in a workitem?

It could be that there is no defined serializer for the apache logger object, and therefore, we cannot serialize it when we background the workflow.

Hi all,

For 8.0 you can use the below 2 lines for and the commented line is for the older version (


Using this you can directly use or log.debug in the workflow and rules.



Does this assume we also import the apache class and create a variable "log" in our code, or is the log variable accessible by all workflows?

The log variable is accessible by all workflows, but if it does not work set the trace variable in the workflow to true

Version history
Revision #:
3 of 3
Last update:
‎Jul 25, 2023 06:16 PM
Updated by: