Log messages from custom Java plugin

Document ID : KB000097837
Last Modified Date : 30/05/2018
Show Technical Document Details
Question:
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
Answer:
Follow the instructions on this doc - https://docops.ca.com/ca-identity-suite/14-1/EN/programming/ca-identity-portal-developer-guide/plugins/developing-a-java-plugin 
and this Example on this doc - https://docops.ca.com/display/CIS141/Plugin+Samples, and was able to write log messages.
Here is my 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