cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Configure Rollingfile loggers in log4j2.properties

Configure Rollingfile loggers in log4j2.properties

Below is how we can enable RollingFile loggers in log4j2

 

## Default Appender ##
appender.rolling.type=RollingFile
appender.rolling.name=IIQRFile
appender.rolling.fileName=C:/SailpointLogs/sailpoint.log
appender.rolling.filePattern=C:/SailpointLogs/sailpoint-%d{yyyy-MM-dd}-%i.log.gz
appender.rolling.layout.type=PatternLayout
## OOTB pattern is '%d{ISO8601} %5p %t %c{4}:%L - %m%n' ##
appender.rolling.layout.pattern=%d{DEFAULT} %5p %t %c{4}:%L - %m%n
appender.rolling.policies.type=Policies
appender.rolling.policies.size.type=SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=200MB
appender.rolling.strategy.type=DefaultRolloverStrategy
appender.rolling.strategy.max=15

## Same as Default Appender, we will use this appender in case where we need the logs generated sperately from the default loggger appender IIQRFile ##
appender.specificFile.type=RollingFile
appender.specificFile.name=IIQSpecificFile
appender.specificFile.fileName=C:/SailpointLogs/Specific/specific.log
appender.specificFile.filePattern=C:/SailpointLogs/Specific/specific-%d{yyyy-MM-dd}-%i.log.gz
appender.specificFile.layout.type=PatternLayout
appender.specificFile.layout.pattern=%d{DEFAULT} %5p %t %c{4}:%L - %m%n
appender.specificFile.policies.type=Policies
appender.specificFile.policies.size.type=SizeBasedTriggeringPolicy
appender.specificFile.policies.size.size=200MB
appender.specificFile.strategy.type=DefaultRolloverStrategy
appender.specificFile.strategy.max=15

## Sailpoint Console Appender same as default, this will be used to log console ##
appender.consoleFile.type=RollingFile
appender.consoleFile.name=IIQConsoleFile
appender.consoleFile.fileName=C:/SailpointLogs/SailpointConsole/console.log.gz
appender.consoleFile.filePattern=C:/SailpointLogs/SailpointConsole/console-%d{yyyy-MM-dd}-%i.log
appender.consoleFile.layout.type=PatternLayout
appender.consoleFile.layout.pattern=%d{DEFAULT} %5p %t %c{4}:%L - %m%n
appender.consoleFile.policies.type=Policies
appender.consoleFile.policies.size.type=SizeBasedTriggeringPolicy
appender.consoleFile.policies.size.size=200MB
appender.consoleFile.strategy.type=DefaultRolloverStrategy
appender.consoleFile.strategy.max=15

 

Below appender can be added if we need to have a separate logger that will only logs error 

 

## Error Only Appender ##
appender.error.type=RollingFile
appender.error.name=IIQErrorFile
appender.error.fileName=C:/SailpointLogs/Error/error.log
appender.error.filePattern=C:/SailpointLogs/Error/error-%d{yyyy-MM-dd}-%i.log
appender.error.layout.type=PatternLayout
appender.error.layout.pattern=%d{DEFAULT} %5p %t %c{4}:%L - %m%n
appender.error.policies.type=Policies
appender.error.policies.size.type=SizeBasedTriggeringPolicy
appender.error.policies.size.size=200MB
appender.error.strategy.type=DefaultRolloverStrategy
appender.error.strategy.max=15
appender.error.filter.threshold.type=LevelRangeFilter
appender.error.filter.threshold.minLevel=error
appender.error.filter.threshold.maxLevel=error

 

Now after listing all the appenders, below is how you have to add the entries in the rootLogger to work with all your appenders

 

#######################################
## rootLogger specify all appender rollings used by your log4j2
#######################################

rootLogger.level=warn
## Only appenderRef that has been used in log4j2, Here we are using all that are part of this example ##
rootLogger.appenderRefs=IIQRFile,IIQErrorFile,IIQSpecificFile,IIQConsoleFile
rootLogger.appenderRef.stdout.ref=stdout

## Specify the default appenderRef and error appenderRef to automate logging ##
rootLogger.appenderRef.rolling.ref=IIQRFile

## To log errors by default ##
rootLogger.appenderRef.error.ref=IIQErrorFile

 

Below is how we will enable IIQ console logger in IIQConsoleFile appender

 

#######################################
## SailPoint Console loggers iiq.bat console
#######################################

logger.spConsole.name=sailpoint.server.SailPointConsole
logger.spConsole.level=all
## remove the below 2 lines if you want to log in default IIQRFile appender ##
logger.spConsole.additivity=false
logger.spConsole.appenderRef.connector.ref=IIQConsoleFile

 

Below is how you will log to your default appender IIQRFile

 

logger.orgSpringframework.name=org.springframework
logger.orgSpringframework.level=info

 

Below is how you can log to your appender IIQSpecificFile in special cases

 

logger.ObjectConfig.name=sailpoint.object.ObjectConfig
logger.ObjectConfig.level=trace
logger.ObjectConfig.additivity=false
logger.ObjectConfig.appenderRef.connector.ref=IIQSpecificFile

 

Disable Heartbeat logger

 

## Disable Heartbeat logger ##
logger.heartbeat.name=sailpoint.server.HeartbeatService
logger.heartbeat.level=off

 

 

Labels (2)
Comments

Hi Guarav,

Thank you for this guide. I am trying to configure log4j2.properties for TimeBasedTriggeringPolicy. However I am getting these two errors:

 

main ERROR Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile. java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
main ERROR Null object returned for RollingFile in Appenders.
main ERROR Unable to locate appender "IIQRFile" for logger config "root"

 

I found the problem, I forgot to add %d to filepattern. 

I have %d in pattern (log4j2) but still having following error.

 [echo] Generating C:\Users\sudhi\git\iam-sailpoint\build\extract/sailpoint.8.1p1.dtd...
[java] 2020-09-09 17:19:39,502 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.FileAppender for element File: java.lang.ClassCastException: org.apache.logging.log4j.core.appender.FileManager$FactoryData cannot be cast to org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData java.lang.ClassCastException: org.apache.logging.log4j.core.appender.FileManager$FactoryData cannot be cast to org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData
[java] at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.updateData(RollingFileManager.java:622)
[java] at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:120)
[java] at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
[java] at org.apache.logging.log4j.core.appender.FileManager.getFileManager(FileManager.java:180)
[java] at org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:96)
[java] at org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:52)
[java] at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:964)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:904)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:896)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
[java] at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:548)
[java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:620)
[java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:637)
[java] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
[java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
[java] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:121)
[java] at org.apache.logging.log4j.jcl.LogAdapter.getContext(LogAdapter.java:39)
[java] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
[java] at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:40)
[java] at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:55)
[java] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
[java] at sailpoint.tools.Util.<clinit>(Util.java:78)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:498)
[java] at sailpoint.launch.Launcher.setJavaLibraryPath(Launcher.java:186)
[java] at sailpoint.launch.Launcher.main(Launcher.java:222)
[java]
[java] 2020-09-09 17:19:39,504 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.FileAppender for element File: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.FileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.FileAppender
[java] at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:234)
[java] at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:134)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:964)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:904)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:896)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
[java] at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:548)
[java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:620)
[java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:637)
[java] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
[java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
[java] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:121)
[java] at org.apache.logging.log4j.jcl.LogAdapter.getContext(LogAdapter.java:39)
[java] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
[java] at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:40)
[java] at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:55)
[java] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
[java] at sailpoint.tools.Util.<clinit>(Util.java:78)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:498)
[java] at sailpoint.launch.Launcher.setJavaLibraryPath(Launcher.java:186)
[java] at sailpoint.launch.Launcher.main(Launcher.java:222)
[java]
[java] 2020-09-09 17:19:39,616 main ERROR Null object returned for File in Appenders.
[java] 2020-09-09 17:19:39,616 main ERROR Unable to locate appender "file" for logger config "root"

Hi @skalapal ,

Can you please share the appender and the rootLogger lines?

Thanks

Hello Gaurav,

So when I used below section, I was not able to compile. But the one below it (adhering to the old loh4j standard) seems to work.

Not Working-
appender.rolling.type=RollingFile
appender.rolling.name=IIQRFile
appender.rolling.fileName=%%TOMCAT_LOG_DIR%%/sailpoint.log
appender.rolling.filePattern=%%TOMCAT_LOG_DIR%%/sailpoint-%d{yyyy-MM-dd}-%i.log.gz
appender.rolling.layout.type=PatternLayout
# OOTB pattern is '%d{ISO8601} %5p %t %c{4}:%L - %m%n' ##
appender.rolling.layout.pattern=%d{DEFAULT} %5p %t %c{4}:%L - %m%n
appender.rolling.policies.type=Policies
appender.rolling.policies.size.type=SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=200MB
appender.rolling.strategy.type=DefaultRolloverStrategy
appender.rolling.strategy.max=15

Working -
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=%%TOMCAT_LOG_DIR%%/sailpoint.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %5p %t %c{4}:%L - %m%n
log4j.appender.file.MaxFileSize=100MB
log4j.appender.file.MaxBackupIndex=10

Thank you so much!

Regards,
Sudhir Paul Kalapala
Identity Services, NUIT-AS | Northwestern University IT| 847.491.4056

Hi @skalapal ,

Please check the appender ref in the logger file.  This should point to the appender IIQRFile.

Check  the section "## rootLogger specify all appender rollings used by your log4j2" in this wiki above.

 

Thanks

Gaurav

Thank you Gaurav,

It looks like I am not getting very lucky even after checking the rootLogger. If there is a safe copy of functional log4j2.properties, would you mind posting? Thank you.

Regards,
Sudhir Paul Kalapala
Identity Services, NUIT-AS | Northwestern University IT| 847.491.4056

Hello Skalapal,

See if this can be of your help.

This is log4j2 file which is working fine in my sandbox environment.

 

#
# (c) Copyright 2018 SailPoint Technologies, Inc., All Rights Reserved.
#
# NOTE: The syntax of this file is different than what it was for
# IdentityIQ 7.3 and earlier. These syntax changes are due to
# our upgrade to log4j version 2.
#
# See https://logging.apache.org/log4j/2.x/manual/configuration.html
# for description of the new syntax.
#

######################################
## Global log4j2 properties
######################################
name=identityiq_default
status=warn
monitorInterval=20
packages=sailpoint.api.logging

#######################################
## Appenders
#######################################

### direct log messages to stdout ###
appender.stdout.type=Console
appender.stdout.name=stdout
appender.stdout.target=SYSTEM_OUT
appender.stdout.layout.type=PatternLayout
appender.stdout.layout.pattern=%d{ISO8601} %5p %t %c{4}:%L - %m%n


# CRLF log injection can reduce the value of application logs. CRLF log injection can
# be neutralized by applying log4j2's replace conversion pattern to a log message. If
# log4j2 environment is set up to use the PatternLayout, then while in stdout or file
# write, an administrator can use the 'replace' conversion pattern to a log message to
# neutralize CRLF sequence to double underscore. In the example below, the inner replace
# pattern replaces a sequence of line feed (\n) and carriage return (\r) to two underscores
# respectively, whereas the outer replace pattern replaces the carriage return and line feed
# sequence of a log message to two underscores respectively. Adjust double underscore from
# both the places as per one's own choice of sequence.
#appender.stdout.layout.pattern=%d{ISO8601} %5p %t %c{4}:%L - %replace{%replace{%m}{\n\r}{__}}{\r\n}{__}%n

### direct log messages to the db
appender.syslog.type=spsyslog
appender.syslog.name=spsyslog

# Below is an example of how to create a logger that writes to a file.
# Uncomment the following five lines, then uncomment the
# rootLogger.appenderRef.file.ref definition below
#appender.file.type=File
#appender.file.name=file
#appender.file.fileName=C:/Windows/Temp/logs/sailpoint.log
#appender.file.layout.type=PatternLayout
#appender.file.layout.pattern=%d{ISO8601} %5p %t %c{4}:%L - %m%n

logger.spConsole.name=sailpoint.server.SailPointConsole
logger.spConsole.level=all

#
# SailPoint metering is useful to help diagnose performance issues.
# Some critical sections of code will gather performance data
# metrics, and will log the data to the meter appender.
#
# Below is an example of how to create a csv of metered data.
# Uncomment the following 11 lines, as well as the logger.apiMeter lines
# near the end of this file
#

appender.RollingFile.type = RollingFile
appender.RollingFile.name = file
appender.RollingFile.fileName=D:/Temp/logs/iiqlogs.log
appender.RollingFile.filePattern = ${LOG_DIR}/iiqlogs.%d{dd-MMM}.log.gz
appender.RollingFile.layout.type = PatternLayout
appender.RollingFile.layout.pattern = %d{ISO8601} %5p %t %c{4}:%L - %m%n
appender.RollingFile.policies.type = Policies
appender.RollingFile.policies.size.type = SizeBasedTriggeringPolicy
appender.RollingFile.policies.size.size=100MB
appender.RollingFile.strategy.type = DefaultRolloverStrategy
appender.RollingFile.strategy.max = 50

 

#######################################
## rootLogger
#######################################

### set default log levels and appenderRef
### valid log levels in increasing order of severity are:
### trace, debug, info, warn, error, fatal, off
### trace is required to get method entry and exit logging

rootLogger.level=error
#rootLogger.appenderRefs=IIQDebug1,IIQDebug2
rootLogger.appenderRef.stdout.ref=stdout

# Uncomment to also write to file appender by default.
# Also need to uncomment the file appender definition above.
rootLogger.appenderRef.file.ref=file

#######################################
## 3rd-party loggers (recommended)
#######################################

# Suppress a warning about using a default configuration
logger.ehcache.name=net.sf.ehcache
logger.ehcache.level=error

# Suppress "narrowing proxy" hibernate warning.
logger.ohe_spc.name=org.hibernate.engine.StatefulPersistenceContext
logger.ohe_spc.level=error

# Suppress warnings about deprecated gadgets during import
logger.jasper_engine_xml.name=net.sf.jasperreports.engine.xml
logger.jasper_engine_xml.level=error

# Note: The following logging properties turn off warnings that result from our
# combination of technologies (Tomahawk/Faceletes/A4J, etc.).
# Commenting them out will result in a slew of parser warnings.
# If you don't want to clutter your logs with a bunch of useless warning
# messages please leave these as they are.

# Suppress warning message about Unparsable lastModified
logger.renderkit1.name=org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader
logger.renderkit1.level=error
# Suppress warning message about response not having <head> or <body> tags
logger.renderkit2.name=org.apache.myfaces.renderkit.html.util.DefaultAddResource
logger.renderkit2.level=error
# Suppress warning message about invalid HTML inside javascript
# See http://www.mail-archive.com/users@myfaces.apache.org/msg50391.html
logger.renderkit3.name=org.apache.myfaces.renderkit.html.util.ReducedHTMLParser
logger.renderkit3.level=error

#######################################
## SailPoint loggers (required)
#######################################

# make sure the syslog code doesn't try to call itself if there's a problem.
# NOTE: The additivity flag is critical here!
logger.syslogAppender.name=sailpoint.api.logging.SyslogAppender
logger.syslogAppender.level=error
logger.syslogAppender.appenderRef.stdout.ref=stdout
logger.syslogAppender.additivity=false

logger.syslogEvent.name=sailpoint.object.SyslogEvent
logger.syslogEvent.level=error
logger.syslogEvent.appenderRef.stdout.ref=stdout
logger.syslogEvent.additivity=false

logger.sailpoint.name=sailpoint
logger.sailpoint.level=error
logger.sailpoint.appenderRef.syslog.ref=spsyslog

# Hibernate logs a warn every time Criteria is used. Supress this until JPA migration is completed -rap
logger.hibernateDeprecation.name=org.hibernate.orm.deprecation
logger.hibernateDeprecation.level=error

#######################################
## SailPoint loggers (troubleshooting)
#######################################

#logger.orgHibernate.name=org.hibernate
#logger.orgHibernate.level=info
#logger.orgHibernate.level=debug
#logger.orgHibernate.level=trace

#logger.hibernateCache.name=org.hibernate.cache
#logger.hibernateCache.level=trace

#logger.orgSpringframework.name=org.springframework
#logger.orgSpringframework.level=info

#logger.orgQuartz.name=org.quartz
#logger.orgQuartz.level=info

# Uncomment to log all SQL and prepared statement parameter values.
#logger.hibernateSQL.name=org.hibernate.SQL
#logger.hibernateSQL.level=debug
#logger.hibernateType.name=org.hibernate.type
#logger.hibernateType.level=trace

# Uncomment this to log all SailPoint generated HQL queries and
# query parameters.
#logger.persistenceHQL.name=sailpoint.persistence.hql
#logger.persistenceHQL.level=trace

# Uncomment to view JSF logging
#logger.phaseTracker.name=sailpoint.web.util.PhaseTracker
#logger.phaseTracker.level=trace
#logger.sunFaces.name=com.sun.faces
#logger.sunFaces.level=trace
#logger.javaxFaces.name=javax.faces
#logger.javaxFaces.level=trace

# Uncomment to enable logging of performance metering data
#logger.apiMeter.name=sailpoint.api.Meter
#logger.apiMeter.level=info
#logger.apiMeter.appenderRef.meter.ref=meter

# Uncomment to enable authentication related logging
#logger.authFilter.name=sailpoint.web.PageAuthenticationFilter
#logger.authFilter.level=debug
#logger.authService.name=sailpoint.service.PageAuthenticationService
#logger.authService.level=debug
#logger.ssoValidator.name=sailpoint.web.sso.DefaultSSOValidator
#logger.ssoValidator.level=debug
#logger.ssoDefault.name=sailpoint.web.sso.DefaultSSOAuthenticator
#logger.ssoDefault.level=debug
#logger.ssoSAML.name=sailpoint.web.sso.SAMLSSOAuthenticator
#logger.ssoSAML.level=debug

# Uncomment to enable detailed multi-factor authentication logging
#logger.mfaFilter.name=sailpoint.web.MFAFilter
#logger.mfaFilter.level=debug
#logger.mfaLibrary.name=sailpoint.workflow.MFALibrary
#logger.mfaLibrary.level=info

# Uncomment to enable detailed statistics monitoring logging
#logger.monitoringService.name=sailpoint.server.MonitoringService
#logger.monitoringService.level=debug

#logger.aggregator.name=sailpoint.api.Aggregator
#logger.aggregator.level=trace

#logger.cacheTracker.name=sailpoint.api.CacheTracker
#logger.cacheTracker.level=trace

#logger.certificationer.name=sailpoint.api.Certificationer
#logger.certificationer.level=info

#logger.remediationManager.name=sailpoint.api.certification.RemediationManager
#logger.remediationManager.level=info

#logger.certificationPhaser.name=sailpoint.api.CertificationPhaser
#logger.certificationPhaser.level=info

#logger.correlationModel.name=sailpoint.api.CorrelationModel
#logger.correlationModel.level=info

#logger.lockTracer.name=sailpoint.api.LockTracker
#logger.lockTracer.level=trace

#logger.managedAttributer.name=sailpoint.api.ManagedAttributer
#logger.managedAttributer.level=info

#logger.provisioner.name=sailpoint.api.Provisioner
#logger.provisioner.level=debug,trace

#logger.oimClient.name=sailpoint.integration.oim.OIMClient
#logger.oimClient.level=info

#logger.objectConfig.name=sailpoint.object.ObjectConfig
#logger.objectConfig.level=info

#logger.dateType.name=sailpoint.persistence.DateType
#logger.dateType.level=info

#logger.debugInterceptor.name=sailpoint.persistence.DebugInterceptor
#logger.debugInterceptor.level=debug

#logger.hibernatePersistenceManager.name=sailpoint.persistence.HibernatePersistenceManager
#logger.hibernatePersistenceManager.level=trace
#logger.hibernatePersistenceManager.level=info

#logger.newXmlType.name=sailpoint.persistence.NewXmlType
#logger.newXmlType.level=info

#logger.sailPointInterceptor.name=sailpoint.persistence.SailPointInterceptor
#logger.sailPointInterceptor.level=info

#logger.xmlType.name=sailpoint.persistence.XmlType
#logger.xmlType.level=info

#logger.sailpointReporting.name=sailpoint.reporting
#logger.sailpointReporting.level=trace

#logger.bsfRuleRunner.name=sailpoint.server.BSFRuleRunner
#logger.bsfRuleRunner.level=trace

#logger.cacheService.name=sailpoint.server.CacheService
#logger.cacheService.level=info

#logger.serverEnvironment.name=sailpoint.server.Environment
#logger.serverEnvironment.level=trace

#logger.iiqRestService.name=sailpoint.service.IIQRestService
#logger.iiqRestService.level=info

#logger.idRefreshExecutor.name=sailpoint.task.IdentityRefreshExecutor
#logger.idRefreshExecutor.level=trace

#logger.roleSynchronizer.name=sailpoint.task.RoleSynchronizer
#logger.roleSynchronizer.level=info

#logger.timingFilter.name=sailpoint.web.util.TimingFilter
#logger.timingFilter.level=trace

#logger.heartbeat.name=sailpoint.server.HeartbeatService
#logger.heartbeat.level=trace

#logger.identityai.name=sailpoint.identityai
#logger.identityai.level=debug

#logger.connector_sm.name=sailpoint.connector.sm
#logger.connector_sm.level=debug

######################## TESTING ###############################

appender.IIQDebug2.type=RollingFile
appender.IIQDebug2.name=IIQDebug2
appender.IIQDebug2.fileName=C:/Windows/Temp/logs/IIQDebug2.log
appender.IIQDebug2.filePattern=${LOG_DIR}/application.%d{dd-MMM}.log.gz
appender.IIQDebug2.layout.type=PatternLayout
appender.IIQDebug2.layout.pattern = %d{ISO8601} %5p %t %c{4}:%L - %m%n
appender.IIQDebug2.policies.type=Policies
appender.IIQDebug2.policies.size.type=SizeBasedTriggeringPolicy
appender.IIQDebug2.policies.size.size=200MB
appender.IIQDebug2.strategy.type=DefaultRolloverStrategy
appender.IIQDebug2.strategy.max=15

logger.aggregator.name=sailpoint.api.Aggregator
logger.aggregator.level=trace
logger.aggregator.additivity=false
logger.aggregator.appenderRef.connector.ref=IIQDebug2

 

Thanks,

Nitish

To turn off the Heartbeat Service we also had to add the following two lines:

logger.statistical.name=org.hibernate.engine.internal.StatisticalLoggingSessionEventListener
logger.statistical.level=off

Hi @Nitish_Raina ,

 

Thanks for posting your working log4j2.properties file.

 

I would really like some help understanding the last line from the file.

line is "logger.aggregator.appenderRef.connector.ref=IIQDebug2"

should this be "logger.aggregator.appenderRef.IIQDebug2.ref=IIQDebug2"

 

why is the "appenderRef.connector" used? any documentation is really helpful

Hi @gaurav_khandelwal , Thank you for this post. I am trying to use the same loggers but am getting below errors. It would be really helpful if you could attach a working copy of log4j2 file. Let me know if you have any pointers for the below error:

2021-06-22 14:17:19,833 main ERROR Unable to locate plugin type for RollingFile
2021-06-22 14:17:19,840 main ERROR Unable to locate plugin type for RollingFile
2021-06-22 14:17:19,842 main ERROR Unable to locate plugin type for RollingFile
2021-06-22 14:17:19,842 main ERROR Unable to locate plugin type for RollingFile
2021-06-22 14:17:19,930 main ERROR Unable to locate plugin for PatternLayout
2021-06-22 14:17:19,931 main ERROR Unable to locate plugin for SizeBasedTriggeringPolicy
2021-06-22 14:17:19,932 main ERROR Unable to locate plugin for Policies
2021-06-22 14:17:19,933 main ERROR Unable to locate plugin for DefaultRolloverStrategy
2021-06-22 14:17:19,933 main ERROR Unable to locate plugin for RollingFile
2021-06-22 14:17:19,961 main ERROR Unable to locate plugin for PatternLayout
2021-06-22 14:17:19,962 main ERROR Unable to locate plugin for SizeBasedTriggeringPolicy
2021-06-22 14:17:19,963 main ERROR Unable to locate plugin for Policies
2021-06-22 14:17:19,964 main ERROR Unable to locate plugin for DefaultRolloverStrategy
2021-06-22 14:17:19,964 main ERROR Unable to locate plugin for RollingFile
2021-06-22 14:17:19,965 main ERROR Unable to locate plugin for PatternLayout
2021-06-22 14:17:19,971 main ERROR Unable to locate plugin for Policies
2021-06-22 14:17:19,975 main ERROR Unable to locate plugin for RollingFile
2021-06-22 14:17:19,987 main ERROR Unable to locate plugin for LevelRangeFilter
2021-06-22 14:17:19,988 main ERROR Unable to locate plugin for PatternLayout
2021-06-22 14:17:19,988 main ERROR Unable to locate plugin for SizeBasedTriggeringPolicy
2021-06-22 14:17:19,989 main ERROR Unable to locate plugin for Policies
2021-06-22 14:17:19,989 main ERROR Unable to locate plugin for DefaultRolloverStrategy
2021-06-22 14:17:19,990 main ERROR Unable to locate plugin for RollingFile
2021-06-22 14:17:19,991 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.config.AppendersPlugin for element Appenders: java.lang.NullPointerException: Cannot invoke "org.apache.logging.log4j.core.config.plugins.util.PluginType.getElementName()" because "childType" is null java.lang.NullPointerException: Cannot invoke "org.apache.logging.log4j.core.config.plugins.util.PluginType.getElementName()" because "childType" is null
at org.apache.logging.log4j.core.config.plugins.visitors.PluginElementVisitor.visit(PluginElementVisitor.java:52)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.generateParameters(PluginBuilder.java:253)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:964)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:904)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:548)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:620)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:637)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:121)
at org.apache.logging.log4j.jcl.LogAdapter.getContext(LogAdapter.java:39)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:40)
at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:55)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
at sailpoint.tools.Util.<clinit>(Util.java:78)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at sailpoint.launch.Launcher.setJavaLibraryPath(Launcher.java:186)
at sailpoint.launch.Launcher.main(Launcher.java:222)

2021-06-22 14:17:19,994 main ERROR Unable to locate appender "IIQRFile" for logger config "root"
2021-06-22 14:17:19,995 main ERROR Unable to locate appender "stdout" for logger config "root"
2021-06-22 14:17:19,995 main ERROR Unable to locate appender "IIQErrorFile" for logger config "root"
2021-06-22 14:17:19,999 main ERROR Unable to locate appender "IIQConsoleFile" for logger config "sailpoint.server.SailPointConsole"
2021-06-22 14:17:20,000 main ERROR Unable to locate appender "stdout" for logger config "sailpoint.api.logging.SyslogAppender"
2021-06-22 14:17:20,001 main ERROR Unable to locate appender "IIQSpecificFile" for logger config "sailpoint.object.ObjectConfig"
2021-06-22 14:17:20,002 main ERROR Unable to locate appender "spsyslog" for logger config "sailpoint"
2021-06-22 14:17:20,002 main ERROR Unable to locate appender "stdout" for logger config "sailpoint.object.SyslogEvent"

 

Version history
Revision #:
5 of 5
Last update:
‎Feb 23, 2023 11:51 AM
Updated by: