Problem/Motivation

In case the log item is longer than what cloudwatch accepts, the module is truncating it to the maximum allowed size. That code produces an error:

>  [error]  TypeError: json_encode(): Argument #2 ($flags) must be of type int, array given in json_encode() (line 200 of /var/www/web/modules/contrib/aws_cloudwatchlogs/src/Servi  
  ces/PutLogEvents.php) #0 /var/www/web/modules/contrib/aws_cloudwatchlogs/src/Services/PutLogEvents.php(200): json_encode(Array, Array, 128)                                          
  > #1 /var/www/web/modules/contrib/aws_cloudwatchlogs/src/Logger/Log.php(179): Drupal\aws_cloudwatchlogs\Services\PutLogEvents->putLog(Object(Aws\CloudWatchLogs\CloudWatchLogsClien  
  t), '[WARNING] [sdc_...', '/app/infoportal...', '/drupal')              

Proposed resolution

Remove the non-existent second parameter from the json_encode call

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

petar_basic created an issue. See original summary.

petar_basic’s picture

Status: Needs work » Needs review
aludescher’s picture

Status: Needs review » Reviewed & tested by the community

  • 9db2b55a committed on 8.x-1.x
    #3557154: Fix call to json_encode when truncating large logs.
    
aludescher’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.