Monday, January 20, 2020

Adding log4j logs in UCCX script


Adding log4j to UCCX script save lot time for debugging and troubleshooting the UCCX code.
Always have log4j implemented in the UCCX script if the script involves more than 20 steps.

1. Add the following 2 instances in the variable pane

1. propertyconfigurator of type org.apache.log4j.PropertyConfigurator   
2. logger of type  org.apache.log4j.Logger  

2. Add following snippet in the uccx script
{
propertyConfigurator.configure("/opt/cisco/uccx/Documents/User/default/" + "log4j.properties");
logger =  org.apache.log4j.LogManager.getLogger("IVR");
}


3.  Add the log4j.properties in the Document management 

log4j.properties:
----------------------------
log4j.category.IVR=DEBUG, IVR

log4j.appender.IVR=org.apache.log4j.RollingFileAppender
log4j.appender.IVR.File=${uccx.customer.dir}/LOGS_IVR.log
log4j.appender.IVR.MaxFileSize=5MB
log4j.appender.IVR.MaxBackupIndex=10
log4j.appender.IVR.layout=org.apache.log4j.PatternLayout
log4j.appender.IVR.layout.ConversionPattern=[%d{dd-MM-YYYY HH:mm:sss}][%t] %5p %c{1} : %m%n

Location : appadmin -->DocumentManagement -->Default folder


4. Check the availability of the logger classes through the script editor. If its not available, ensure to add log4j-1.2.17.jar to the class path adding in custom file configuration in appadmin page and restart UCCX engine and UCCX appadmin services through UCCX serveability page

Refer : Useful CLI commands for steps to collect the logs


No comments:

Post a Comment

Finesse gadget integration

 Finesee gadget samples https://github.com/CiscoDevNet/finesse-sample-code URL for js files http(s)://<FQDN>:<port>/desktop/asse...