Configure Agent Logging

Topics marked with * relate to features available only in vFabric Hyperic.

Agent Log Files

Agent log files are stored in the AgentHome/log directory. They include:

  • agent.log

  • agent.startup.log

  • wrapper.log - The agent JSW-based launcher writes messages to this log.

Configure Agent Log Name or Location

Use these properties to change the name or location of the agent log file:

agent.logDir

Description

You can add this property to the agent.properties file to specify the directory where the Hyperic Agent will write its log file. Unless you specify a fully qualified path, agent.logDir is evaluated relative to the agent installation directory.

This property does not exist in agent.properties unless you explicitly add it.  To change the location for the agent log file, add agent.logDir  to agent.properties and enter a path relative to the agent installation directory, or if desired, a fully qualified path.

Note that the name of the agent log file is configured with the agent.logFile property.

Default

agent.logDir does not exist in agent.properties unless you explicitly add it.  The default behavior is equivalent to this setting:

agent.logDir=log

resulting in the agent log file being written to the AgentHome/log directory.

agent.logFile

Description

Specifies the path and name of the agent log file.

Default

Note that in agent.properties, the default setting for agent.LogFile is made up of a variable and a string.

agent.logFile=${agent.logDir}\agent.log
  • agent.logDir is a variable - it supplies the value of an identically named agent property. By default, the value of agent.logDir is log, interpreted relative to the agent installation directory.

  • agent.log is the name for the agent log file.

So, by default, the agent log file is named agent.log, and is written to the AgentHome/log directory.

If you want the agent to the log to a different directory, you must explicitly add the agent.logDir property to agent.properties.

Configure Agent Logging Level

Use this property to control what severity of messages that agent writes to the agent log file:

agent.logLevel

Description
Specifies the level of detail of the messages the Agent writes to the log file. Allowable values are: INFO and DEBUG.
Default
INFO

Setting the agent.logLevel to to "DEBUG" level is not advised. This level of logging across all subsystems will impose overhead, and can also cause the log file to roll over so frequently that log messages of interest are lost. It is preferable to configure debug level logging only at the subsystem level, as described in Configure Debug Log Level for an Agent Subsystem.

Redirect System Messages to the Agent Log

Use these properties to redirect system-generated messages to the agent log file:

agent.logLevel.SystemErr

Description

Redirects System.err to agent.log. Commenting out this setting will cause System.err to be directed to agent.log.startup.

Default

ERROR

agent.logLevel.SystemOut

Description

Redirects System.out to agent.log. Commenting out this setting will cause System.out to be directed to agent.log.startup.

Default

INFO

Configure Debug Log Level for an Agent Subsystem

For troubleshooting purposes you can increase logging level for an individual agent subsystem. To do so, uncomment the appropriate line in the section of agent.properties labelled "Agent Subsystems: Uncomment individual subsystems to see debug messages", shown in the excerpt below.

Agent log4j Properties

The log4j properties in agent.properties are excerpted below.

log4j.rootLogger=${agent.logLevel}, R

log4j.appender.R.File=${agent.logFile}
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.MaxFileSize=5000KB
log4j.appender.R.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss,SSS z} %-5p [%t] [%c{1}@%L] %m%n
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R=org.apache.log4j.RollingFileAppender

##
## Disable overly verbose logging 
##
log4j.logger.org.apache.http=ERROR
log4j.logger.org.springframework.web.client.RestTemplate=ERROR
log4j.logger.org.hyperic.hq.measurement.agent.server.SenderThread=INFO
log4j.logger.org.hyperic.hq.agent.server.AgentDListProvider=INFO
log4j.logger.org.hyperic.hq.agent.server.MeasurementSchedule=INFO
log4j.logger.org.hyperic.util.units=INFO
log4j.logger.org.hyperic.hq.product.pluginxml=INFO

# Only log errors from naming context
log4j.category.org.jnp.interfaces.NamingContext=ERROR
log4j.category.org.apache.axis=ERROR

#Agent Subsystems: Uncomment individual subsystems to see debug messages.
#-----------------------------------------------------------------------
#log4j.logger.org.hyperic.hq.autoinventory=DEBUG
#log4j.logger.org.hyperic.hq.livedata=DEBUG
#log4j.logger.org.hyperic.hq.measurement=DEBUG
#log4j.logger.org.hyperic.hq.control=DEBUG

#Agent Plugin Implementations 
#log4j.logger.org.hyperic.hq.product=DEBUG

#Server Communication 
#log4j.logger.org.hyperic.hq.bizapp.client.AgentCallbackClient=DEBUG

#Server Realtime commands dispatcher 
#log4j.logger.org.hyperic.hq.agent.server.CommandDispatcher=DEBUG 

#Agent Configuration parser
#log4j.logger.org.hyperic.hq.agent.AgentConfig=DEBUG

#Agent plugins loader 
#log4j.logger.org.hyperic.util.PluginLoader=DEBUG 

#Agent Metrics Scheduler (Scheduling tasks definitions & executions) 
#log4j.logger.org.hyperic.hq.agent.server.session.AgentSynchronizer.SchedulerThread=DEBUG 

#Agent Plugin Managers 
#log4j.logger.org.hyperic.hq.product.MeasurementPluginManager=DEBUG
#log4j.logger.org.hyperic.hq.product.AutoinventoryPluginManager=DEBUG
#log4j.logger.org.hyperic.hq.product.ConfigTrackPluginManager=DEBUG
#log4j.logger.org.hyperic.hq.product.LogTrackPluginManager=DEBUG
#log4j.logger.org.hyperic.hq.product.LiveDataPluginManager=DEBUG
#log4j.logger.org.hyperic.hq.product.ControlPluginManager=DEBUG