Unable to found previous logs

Solution Verified - Updated -

Environment

  • Red Hat Mobile Application Platform ( RHMAP ) - 3

Issue

  • Unable to found previous logs
  • Log retention policy in the log archive is inconsistent across cloud and MBaaS applications.
  • What is the default log retention policy on RHMAP?

Resolution

Refine logs to bring down file size.

Typically stdout logs have a maximum file size of 10MB and stderr logs have a maximum file size of 5MB. The logs are rotated when the maximum file size is reached and there is a maximum file count of 5. This provides a maximum of 50MB of logs for stdout and 25MB of logs for stderr. If logs are exceeding this maximum they should be revised to only include important information during production. Production logs should not include debugging data.

An important note: Often times, logging JavaScript objects, results in useless strings such as [object Object] and can take up valuable space. Careful thought must be given to the necessity of logging them. If they absolutely must be logged, JSON.stringify should be used to ensure output is useful.

Note: There is an enhancement request for users to be able to configure log related setting, but it is not yet implemented.

Root Cause

Working as intended. Logs are rotated based on file size.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments