Custom Application logs stopped coming in DevTest 10.7.2
search cancel

Custom Application logs stopped coming in DevTest 10.7.2

book

Article ID: 267735

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

Upgraded to 10.7.2, and after that the logs are not writing/coming in mentioned path neither on home path.

Have configured the log path and filename in respective component's vmoptions file.

Below are the custom entries added in the logging.properties file:  (SPLUNK and EXCEPTION)

###########################################
# Splunk Custom logging
############################################
log4j.logger.Splunk=INFO, SPLUNKAPP
log4j.additivity.Splunk=false
log4j.appender.SPLUNKAPP =org.apache.log4j.RollingFileAppender
log4j.appender.SPLUNKAPP.File=${lisa.tmpdir}/splunk_custom.log
log4j.appender.SPLUNKAPP.MaxFileSize=10MB
log4j.appender.SPLUNKAPP.MaxBackupIndex=20
log4j.appender.SPLUNKAPP.layout=org.apache.log4j.PatternLayout
log4j.appender.SPLUNKAPP.layout.ConversionPattern=[%d{ISO8601}] %m%n

############################################
# Exception Custom logging
############################################
log4j.logger.CustomException=INFO, EXCEPTIONAPP
log4j.additivity.CustomException=false
log4j.appender.EXCEPTIONAPP =org.apache.log4j.RollingFileAppender
log4j.appender.EXCEPTIONAPP.File=${lisa.tmpdir}/exception_custom.log
log4j.appender.EXCEPTIONAPP.MaxFileSize=10MB
log4j.appender.EXCEPTIONAPP.MaxBackupIndex=20
log4j.appender.EXCEPTIONAPP.layout=org.apache.log4j.PatternLayout
log4j.appender.EXCEPTIONAPP.layout.ConversionPattern=[%d{ISO8601}] %m%n

 

Environment

Release : 10.7.2 and later

Cause

Syntax error.

Resolution

These changes resolve issue:

#----------------
#APPENDERS
#----------------
appenders = A1, ACL_LOG, VSEAPP, ADVICE_APP, THREAD_DUMPS, STDOUT, SPLUNKAPP, EXCEPTIONAPP

#----------------
#LOGGERS
#----------------
# The following lines adjust the log levels of third-party libraries used by LISA so that
# they don't clutter the logs with messages unrelated to LISA.
loggers = teamdev, eventlogger, apache, smardec, apachehttp, mchange, hibernate, jfree, jniwrapper, rmi, threadDumper, eclipse, codehaus, grails, springframework, jndi, flywaydb, jayway, sf, quartz, jettyAnnotationParser, jettyWebContext, NIOSession, springsecuritycore, springsecurityldap, springldapcore, securityAuth, VSE, ADVICE, threadDumpLogger, hibernateorm, apachehttpheader, apachehttpwire, Splunk, CustomException

###########################################
# Splunk Custom logging
############################################

appender.SPLUNKAPP.type = RollingFile
appender.SPLUNKAPP.name = SPLUNKAPP
appender.SPLUNKAPP.fileName = ${sys:lisa.tmpdir}/splunk_custom.log
appender.SPLUNKAPP.filePattern =${sys:lisa.tmpdir}/splunk_custom.log.%i
appender.SPLUNKAPP.layout.type = PatternLayout
appender.SPLUNKAPP.layout.pattern = %d{yyyy-MM-dd'T'HH:mm:ss,SSSZ} %c{1} [%p] %m%n
appender.SPLUNKAPP.policies.type = Policies
appender.SPLUNKAPP.policies.size.type = SizeBasedTriggeringPolicy
appender.SPLUNKAPP.policies.size.size = 10MB
appender.SPLUNKAPP.strategy.type = DefaultRolloverStrategy
appender.SPLUNKAPP.strategy.max = 20
appender.SPLUNKAPP.strategy.fileIndex = min

logger.Splunk.name = Splunk
logger.Splunk.level = INFO
logger.Splunk.additivity = false
logger.Splunk.appenderRefs = SPLUNKAPP
logger.Splunk.appenderRef.SPLUNKAPP.ref = SPLUNKAPP

############################################
# Exception Custom logging
############################################

appender.EXCEPTIONAPP.type = RollingFile
appender.EXCEPTIONAPP.name = EXCEPTIONAPP
appender.EXCEPTIONAPP.fileName = ${sys:lisa.tmpdir}/exception_custom.log
appender.EXCEPTIONAPP.filePattern =${sys:lisa.tmpdir}/exception_custom.log.%i
appender.EXCEPTIONAPP.layout.type = PatternLayout
appender.EXCEPTIONAPP.layout.pattern = %d{yyyy-MM-dd'T'HH:mm:ss,SSSZ} %c{1} [%p] %m%n
appender.EXCEPTIONAPP.policies.type = Policies
appender.EXCEPTIONAPP.policies.size.type = SizeBasedTriggeringPolicy
appender.EXCEPTIONAPP.policies.size.size = 10MB
appender.EXCEPTIONAPP.strategy.type = DefaultRolloverStrategy
appender.EXCEPTIONAPP.strategy.max = 20
appender.EXCEPTIONAPP.strategy.fileIndex = min

logger.CustomException.name = CustomException
logger.CustomException.level = INFO
logger.CustomException.additivity = false
logger.CustomException.appenderRefs = EXCEPTIONAPP
logger.CustomException.appenderRef.EXCEPTIONAPP.ref = EXCEPTIONAPP

Additional Information

The syntax in Log4J 2 changed. We have documented the syntax for log 4J1 and 2 in 10.7 documentation. 

https://techdocs.broadcom.com/us/en/ca-enterprise-software/devops/devtest-solutions/10-7/reference/property-descriptions/custom-property-files/logging-properties-for-10-7-2-or-higher-versions.html