Hi,

We use the Akamai module along with Lagoon logs.

The D10 Akamai module now requires Monolog 3.x.

See:
https://git.drupalcode.org/project/akamai/-/blob/5.x/composer.json#L16
https://github.com/FranceMediasMonde/AkamaiOPEN-edgegrid-php-client/blob...

Merge request (to be reviewed) will follow to make Lagoon Logs compatible with Monolog 3.x.

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

GuillaumeG created an issue. See original summary.

guillaumeg’s picture

Category: Feature request » Task
tobybellwood’s picture

Thanks @guillaumeg - I’ll check the MR out once it’s up. IIRC there was something we needed to change for monolog 3, but can’t recall it!

guillaumeg’s picture

Status: Active » Needs review
bomoko’s picture

Status: Needs review » Needs work

Hi @GuillaumeG

Thanks for the MR, it's greatly appreciated.

Would you mind expanding a little on why you've removed the `LagoonLogsLogProcessor`?
Without it seems as though we're not getting a bunch of the fields that are calculated by `transformDataForProcessor`.

From my side, just to test, I've restored `LagoonLogsLogProcessor` and changed it's invoke signature to `public function __invoke(\Monolog\LogRecord $record) {` and this seems to bring the log details back in line with what the module is currently producing.

Some more info on this would be super. Thanks!

guillaumeg’s picture

Hi bomoko,

Thanks a lot for checking the MR.

I removed LagoonLogsLogProcessor because I was able to get all the fields in the logs (OpenSearch) without this class and could not see any difference when comparing with a previous log entry.

Happy to restore the file with the changes you proposed if I am missing something, which is surely the case !
Or feel free to push a commit to my MR directly if you prefer.

bomoko’s picture

Ah, thanks for the clarification!

I was actually testing locally capturing the udp output with nc - I wonder if there's some weirdness going on downstream.

This is what I was seeing, in terms of the difference in structure :-

Without LagoonLogsLogProcessor:

{
  "@timestamp": "2023-07-16T21:35:20.016453+00:00",
  "@version": 1,
  "host": "8b8e14550172",
  "message": "The file assets://js was not deleted because it does not exist.",
  "type": "project_unset-safe_branch_unset",
  "channel": "file",
  "level": "NOTICE",
  "monolog_level": 250
}

With LagoonLogsLogProcessor:

{
  "@timestamp": "2023-07-16T21:29:30.469535+00:00",
  "@version": 1,
  "host": "8b8e14550172",
  "message": "The file assets://js was not deleted because it does not exist.",
  "type": "project_unset-safe_branch_unset",
  "channel": "file",
  "level": "NOTICE",
  "monolog_level": 250,
  "ip": "127.0.0.1",
  "request_uri": "http://drupal10-base.docker.amazee.io/",
  "uid": 0,
  "link": "",
  "application": "drupal"
}

Which makes sense because the processor _should_ attach this arbitrary data to the log entry.

I wonder what's happening that it didn't make a difference for you between the two cases? This is the kind of mystery that keeps me up at night :D

tobybellwood’s picture

I've just rerun in opensearch and can confirm that those fields are indeed missing from this branch, so will need readding in

guillaumeg’s picture

Hi @bomoko / tobybellwood,

Thanks both, I was definitely missing these fields.

I have re-added the file with some changes to make it work with the LogRecord class.

Ready for review again.

guillaumeg’s picture

Status: Needs work » Needs review
bomoko’s picture

Status: Needs review » Reviewed & tested by the community

Looking good @GuillaumeG - I've pinned your changes to D10+ only, and we'll release this as a new major version.

  • bomoko committed 85ac6173 on 3.x authored by GuillaumeG
    Issue #3374539 by GuillaumeG, bomoko, tobybellwood: Support Monolog 3.x
    
bomoko’s picture

Status: Reviewed & tested by the community » Fixed

Merging into the new 3.x branch - thanks to all!

tobybellwood’s picture

Status: Fixed » Closed (fixed)