Unable to see connector rule logs

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:

  1. Using SailPoint API
    https://community.sailpoint.com/t5/IdentityNow-Articles/Enabling-Connector-Logging-in-IdentityNow/ta-p/188107

  2. Directly enabling the logger in log4j.properties file on the VA server
    CCG Enable Debug Log by Connector - Compass

Any help is appreciated. Thank you!

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.

logger.JDBCConnector.name = sailpoint.connector.JDBCConnector
logger.JDBCConnector.level = debug
logger.JDBCConnector.additivity = false
logger.JDBCConnector.appenderRef.rolling.ref = STDOUT

Thank You!

2 Likes

Hi @antra_saxena ,

Enabling connector logging via API should be an easy and quick way. Have you tried as same as below?

Note: you may need to wait at least for 5 min to have changes reflected

{
    "durationMinutes": 60,
    "rootLevel": "INFO",
    "logLevels": {
        "sailpoint.connector.JDBCConnector": "DEBUG"
    }
}

Hi Rohit,

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”

Hi @JackSparrow , thank you for your response. Yes I had enabled the logging using API.

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.

1 Like

Hi Antra,

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.

Thank You!

3 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.