Starting in TAS v3.0+ every application in the foundation will have a log rate limit in bytes configured whether it's manually specified or inheriting a default value. The new TAS property
cloud_controller_default_log_rate_limit_app sets the default value for apps to
inherit if the limit is not manually specified. This property defaults to 16834 bytes and is configurable.
Upon an upgrade to TAS v3.0+, existing apps will be migrated with their log limits set to the value of -1 (unlimited). Setting the log limit to -1 allows existing apps to continue logging as they were before the upgrade however new app deploys
will inherit the default value for the log rate limit if one is not specified. To elaborate on this concept consider the following scenario:
- TAS is upgraded to v3.0+
- App1 migrated up with value -1 for the log limit.
- A blue/green deployment for App1 takes place, and no log limit is specified.
In this scenario, the newly deployed App1 will have a new guid and will be viewed as a new application to the platform. Since there was no log limit specified in the deploy, it will inherit 16834 from the default setting as its log limit. This may be undesired if App1 is unexpectedly limited on log throughput. App1 may see the following log indicating that the limit was exceeded:
2023-07-21T13:02:42.55-0400 [APP/PROC/WEB/0] OUT app instance exceeded log rate limit (16834 bytes/sec)
To quickly allow App1's logging to be unblocked from the limit we could use the cf CLI to scale the log limit:
cf scale App1 -l -1
Once the log limit is updated to -1 (unlimited) a restart the application is necessary. This unblocks App1's log limit and allows logs to start flowing again until a proper limit can be discovered and set.
The new log limiting feature in TAS v3.0+ is optimized for platform operators to have more granular control on platform logging activity however being aware of the feature's configuration options and behavior is important for a smooth experience.
Developers will have the ability to:
- Specify the log rate limit in the app manifest. More details about this manifest attribute can be found here.
- Use a compatible cf CLI version (v8.5+) and set the log rate limit via cf scale <APP-NAME> -l.
Platform Operators will have the ability to:
- Configure a maximum bytes of logs allowed per second per app at the org and space level via quotas. For more information on creating and modifying quota plans please see this documentation.
- Set a default bytes per second limit for applications to inherit if a limit is not specified in the app's manifest. See item 8 in the Configuring App Developer Controls docs.
- Configure app log rate limits for individual apps via cf scale <APP-NAME> -l.
When updating a log limit for an application, the application will need to be restarted before the new limit will take effect.
Each application instance will have a GAUGE metric emitted indicating its log_rate. For example:
2023-07-19T17:03:56.35-0400 [logger-app/4] GAUGE log_rate:8196.200000 B/s
indicates that instance 4 of logger-app is hitting a log_rate of 8196 bytes per second.
The
log_rate metric may be helpful when determining log limit settings for a foundation. Every foundation is uniquely different and may have different requirements when strategizing the defaults to configure. An example strategy may look like the following:
- Upgrade foundation to TAS v3.0 which will cause all apps to migrate with unlimited log limits.
- Monitor the log_rate metrics in the foundation to get an idea of logging throughput needs. This area of investigation would include identifying noisy applications and validating if that app's logging throughput is necessary.
- Set a good foundation default limit for apps to inherit based on the findings from evaluating log_rate metric data.
- For any orgs or spaces that have unnecessarily noisy applications, configure a quota specifying the maximum allowed amount of log bytes per second and apply to that org or space.
- Manually update log limits on any remaining applications not covered under the previous steps.
Deprecated Feature ReintroducedThe global log-lines per second feature was removed from the following versions of TAS:
- v4.0.0 - v4.0.19
- v5.0.0 - v5.0.9
The global log-lines per second feature was reintroduced starting in the following versions of TAS: