This is documentation for Apprenda 7 and 8.
Documentation for newer version is available at https://new.docs.apprenda.com.

Logging Configuration Options

Platform Registry Settings for Log Message Management

The Platform Registry Setting below can be used fo configure how the Platform sends, stores, and deletes log messages. 

Name Explanation Values

Logging.Aggregation.Method

Default aggregation method used to group log messages into e-mail notifications when log aggregation is enabled in a Log Override. This will only affect Log Overrides for Java Web Applications.

Pre-processed: Log messages are aggregated based on the event message (%m) regardless of the log pattern set in the Developer Portal

Post-processed: (default) Log messages are aggregated based on the log pattern set in the Developer Portal

(values are case sensitive)

Logging.AllowDevelopersToDeleteEntries
 
Allow developers to delete log messages generated by their guest applications. True,False
Logging.Application.MaxAgeDays
 
Maximum number of days that logs will be retained for guest applications. Any positive integer or 0 (which indicates no limit)
Logging.Application.MaxSizeMBs
 
Maximum size (in MBs) of logs that will retained per guest application. Any positive integer or 0 (which indicates no limit)
Logging.Application.PruningSweepBatchDelayTimeInSeconds
 
Time (in seconds) that the Platform will pause in between processing batches of database tables when pruning logs. Any positive integer
Logging.Application.PruningSweepBatchSize
 
The maximum number of database tables where log pruning will occur at any one time. Any positive integer
Logging.Application.PruningSweepInMinutes
 
Time (in minutes) in between sweeps that the Platform performs to execute log pruning (delete guest application logs messages) when a non-zero value is set for the Logging.Application.MaxAgeDays or Logging.Application.MaxSizeMBs settings. Any positive integer
Logging.MaxBatchSize
 
Sets the maximum number of log messages log messages that the logging service will accumulate before sending the batch to the appropriate logging database; a batch will be sent once it reaches this size. Any positive integer
Logging.MaxBatchTimeMs
 
Time the Platform will wait in between sending batches of logs to the appropriate logging database. Any positive integer
Logging.WriteLogFileOnPlatformLoggerFailure
 
When set to True, the logging client will write Platform logs to a local file in the instances folder if it is unable to send the logs to the platform for any reason. True,False

Java Logging Configuration 

The Apprenda Platform offers Platform Operators a significant amount of control over how logging is configured for Java guest applications and application servers. It is important that the configured Java logging behavior (and any changes made to it) be conveyed to developers so that they may configure their Java applications accordingly. Configuration options have been organized into the following sections below:

Bootstrap Policies and Java Guest Application Logging

The Application Bootstrap Policy listed below is created upon Platform installation and will affect Java logging behavior.

Name Explanation
Apprenda log4j Appender
 
This policy will enhance or create (if it does not exist) log4j configuration to direct log messages to the Apprenda platform.

The above bootstrap policy will configure all guest applications to use the Apprenda log4j Appender, which determines how log messages are sent to the Platform. When the bootstrap policy is invoked, it will overwrite existing log4j configuration, meaning that any additional appenders (such as those that direct logs to a local file) will be removed.

At installation, the bootstrap policy is configured to run for all Java Web Application workloads. In order to afford the Platform Operator the utmost flexibility in controlling how java logging works on the Apprenda Platform, the following Platform-wide modifications may be made:

  • The Apprenda log4j Appender Application Bootstrap Policy may be configured to run conditionally based on a Custom Property (created by the Platform Operator) that is both visible to and editable by developers. This would allow developers to choose whether or not to invoke the policy upon application deployment. By not invoking the policy, developers would then have the freedom (and responsibility) to configure their application to use the Apprenda Appender (if the desired behavior is to log to the Platform), and may also configure additional appenders (e.g., one that writes to a local file) without having them overwritten by the Apprenda log4j Appender policy.
  • The Apprenda log4j Appender Application Bootstrap Policy may be disabled. Developers would then have the freedom (and responsibility) to configure their application to use the Apprenda Appender (if the desired behavior is to log to the Platform), and may also configure additional appenders (e.g., one that writes to a local file) without having them overwritten by the Apprenda log4j Appender policy.
  • The Apprenda log4j Appender Application Bootstrap Policy may be disabled, and the Platform Operators may author a custom bootstrapper that determines log4j configuration behavior, which can then be uploaded to the Platform through an Application Bootstrap Policy. The policy may be configured to applied to all Java Web Application workloads or ot run conditionally based on a Custom Property created by the Platform Operator.

Logging for Java Application Servers (Containers)

The application container's logging configuration contains two loggers defined explicitly by Apprenda 

  • A logger for Apprenda classes (i.e. com.apprenda) is set to Debug level
  • A logger for Tomcat (i.e. org.apache.catalina) is set to Info

The root logger level can be set by simply using the Default App Server Log4j Root Logger Level Custom Property described below (no bootstrap policy is needed). If the Custom Property is not set, the root logger defaults to Error level. 

The logging configuration for Tomact and JBoss application servers may be altered using a custom platform-mods bootstrapper and corresponding Application Bootstrap Policy. For instance, for Tomcat a custom log4j configuration file can be placed in the custom platform-mods bootstrapper at platform-mods\lib\log4j.xml

Please note that logging for Linux ServicesDocker, and WebSphere function as indicated in their dedicated documentation pages.

Custom Properties for Java Application Logging

The Custom Properties listed below are created upon Platform installation and will affect Java logging behavior

Name Explanation Values
Default log4j Level for the Application Server Root Logger
 
This property controls the log level of the application server root logger if the container does not provide a root logger configuration of its own. debug, info, warn, error, fatal, all, off

Default log4j Level for Application Root Logger

This property controls the log level of the application root logger when the application does not provide a log4j configuration of its own. debug, info, warn, error, fatal, all, off

At installation the above properties and their values are neither visible to nor editable by developers. As needed, the Custom Properties may be edited to make one or both visible and/or editable to developers.