Log messages from custom Java plugin
search cancel

Log messages from custom Java plugin

book

Article ID: 97837

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Governance CA Identity Portal

Issue/Introduction

Is there a way to send the log messages from Java custom plugin to Sigma logs using the Sigma APIs? 

System.out.println messages from custom Java code shows up in wildfly logs. 

Environment

CA Identity Manager 14.x

Resolution

Follow the instructions on this doc -
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/layer7-identity-and-access-management/identity-portal/14-1/programming/ca-identity-portal-developer-guide/plugins/developing-a-java-plugin.html

using the Example in this doc=
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/layer7-identity-and-access-management/identity-portal/14-1/programming/ca-identity-portal-developer-guide/plugins/plugin-samples.html

and was able to write get this to write log messages.  Here is the Example code:

package org.ca.idp.pluging_logger; <<<<----------------------------------- package setup 
import com.idmlogic.sigma.plugin.BasePlugin; 
import com.idmlogic.sigma.plugin.annotations.ExportedServerFunction; 

public class pluginLogger extends BasePlugin { 
@Override 
public void initPlugin() { 
System.err.println("init"); 

@ExportedServerFunction 
public void foo() { 
System.err.println("foo error"); 
System.out.println("running foo"); 




Do not forget to place your complied class under the plugin directory configured on Admin UI/Setup/General configuration, my compiled class was placed under:
{plugin directory}/org/ca/idp/plugging_logger ,this match to my package setup. 

Use <Identity_Portal_url>/rest/admin/plugins/refresh URL to reload all available classes in the plugin directory,
and now you should be able to configure the plugin in the 'Plugins' Elements on Admin UI