The Platform Registry Setting below can be used to configure how the Platform sends, stores, and deletes log messages.
|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)
||Allow developers to delete log messages generated by their guest applications.||True,False|
||Maximum number of days that logs will be retained for guest applications.||Any positive integer or 0 (which indicates no limit)|
||Maximum size (in MBs) of logs that will retained per guest application.||Any positive integer or 0 (which indicates no limit)|
||Time (in seconds) that the Platform will pause in between processing batches of database tables when pruning logs.||Any positive integer|
||The maximum number of database tables where log pruning will occur at any one time.||Any positive integer|
||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|
||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|
||Time the Platform will wait in between sending batches of logs to the appropriate logging database.||Any positive integer|
||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|
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:
The Application Bootstrap Policy listed below is created upon Platform installation and will affect Java logging behavior.
|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 application container’s logging configuration contains two loggers defined explicitly by Apprenda
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
The Custom Properties listed below are created upon Platform installation and will affect Java logging behavior
|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.