Skip to content

Update/ajax logging - #172

Merged
amerk-sitecrafting merged 4 commits into
mainfrom
update/ajax-logging
Oct 5, 2026
Merged

amerk-sitecrafting merged 4 commits into
mainfrom
update/ajax-logging

Conversation

@amerk-sitecrafting

Copy link
Copy Markdown
Contributor

Ticket: # 248

Issue

The AbstractBase does not support logging for Ajax requests

Solution

Now it does!

I've also updated the docs and changelog.

Impact

None, all existing code should continue to work as is. The only change to source code includes optional arguments

Usage Changes

Add a not-quite-the-same static log() function to AbstractBase.

Considerations

While logging in the AjaxHandler is neat, we could explore a more generic, global solution for logging that could be used in PHP, Twig, and does not require much setup on the developer's part.

Testing

I've included updated unit tests for the new logging functionality. PHPStan came back clean, and all tests pass.

@rhendrickson-sc rhendrickson-sc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you for your patience with this.

I left 2 comments but they're just questions, no need to change anything before merging.

Comment thread docs/changelog/2026.md
* Remove dependencies that were no longer needed.
* Migrate from [Gitbook](https://www.gitbook.com) to [VitePress](https://vitepress.dev).

## v1.0.5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally optional, but I've noticed that most projects will put their most recent changes at the top of the change-log instead of at the bottom. Not sure if that's something you'd want to do, or if this approach follows an existing convention we do.

$this->action = $request['action'];
$this->request = $request;
$this->action_methods = [];
static::$logger = $logger;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question: why do the other parameters follow $this-> but the logger is doing static::?

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying conifer-plugin with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9b61df9
Status:⚡️  Build in progress...

View logs

@amerk-sitecrafting
amerk-sitecrafting merged commit 9b61df9 into main Oct 5, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants