I am writing a simple JDBC build map rule and have added log statements in the rule. But I am unable to see those logs getting printed in the ccg.log file.
Within the rule, I used this statement to initialise logger:
Logger log = LogManager.getLogger("rule.StagingDBBuildMapRule");
I tried enabling logs (for the JDBC Connector as well as the rule class mentioned above) using the following methods but none of it worked:
Hi @antra_saxena ,
Welcome to the SailPoint developer community!
I faced the same issue. It didnât work with log.info or log.debug in my code, but when I tried with log.warn , it printed the logs. Please try using log.warn , it might work for you. Also, set the JDBC connector log on the VA server as below.
Thank you for your response. I tried using log.warn and log.error, and I am seeing some messages in the logs. But they are embedded as âmessagesâ deep within some other logs - please see the attached screenshot. Do we usually see connector rule logs like this?
Also, I see the following line being printed multiple times, that doesnât seem correct based on the logic in my rule. Makes me wonder if this is the correct place to check logs.
âstagingdbbuildmap: ##########################HRDepartmentAssignedDepartmentId value : 8651â
Yes, that is typically how you see the logs, thereâs not much to do about this.
I typically add some common line in my log statements, which makes it easier to grep on them. For instance:
log.error(âExample log: error in this thingâ)
If you add this prefix at every log statement, this would allow you to grep on the word âExample logâ.
What I also typically do is copy paste the log file to a text editor, so that you can format it as json, which makes reading the logs easier as well.
Yes, on the VA server, the logs appear like this. To see the log more clearly, you can add a log statement in your rule with some special character i.e. (===========), which will be reflected in the logs accordingly.