You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/wpgraphql-logging/README.md
+54-15Lines changed: 54 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ A WPGraphQL logging plugin that provides visibility into request lifecycle to he
6
6
*[Documentation](#getting-started)
7
7
8
8
> [!CAUTION]
9
-
> This plugin is currently in development state and is not production ready.
9
+
> This plugin is currently in alpha state and is not production ready but please feel free to test.
10
10
11
11
-----
12
12
13
-
@TODO - Badges
13
+
@TODO
14
14
15
15
-----
16
16
@@ -19,8 +19,9 @@ A WPGraphQL logging plugin that provides visibility into request lifecycle to he
19
19
## Table of Contents
20
20
21
21
-[Overview](#overview)
22
-
-[Features](#features)
23
22
-[Getting Started](#getting-started)
23
+
-[Features](#features)
24
+
-[Usage](#usage)
24
25
-[Configuration](#configuration)
25
26
-[Extending the Functionality](#extending-the-functionality)
26
27
-[Testing](#testing)
@@ -37,14 +38,16 @@ Designed with extensibility in mind, developers can easily customize and extend
37
38
38
39
---
39
40
40
-
## Features
41
41
42
-
@TODO
42
+
## Getting Started
43
43
44
+
To install, you need to follow our guide here to install the plugin via composer - [https://github.com/wpengine/hwptoolkit/blob/main/docs/how-to/install-toolkit-plugins/index.md]
44
45
45
-
## Getting Started
46
+
Once you have the composer repository setup, please run `composer req wpengine/wpgraphql-logging:*` to install the plugin.
46
47
47
-
@TODO
48
+
Plugin should start logging data, once activated.
49
+
50
+
@TODO add more info once we have configuration setup.
48
51
49
52
50
53
---
@@ -53,10 +56,10 @@ Designed with extensibility in mind, developers can easily customize and extend
-**Before Execution** (`graphql_before_execute`): includes a snapshot of request `params`.
81
+
-**Before Response Returned** (`graphql_return_response`): inspects `response` and automatically upgrades level to Error when GraphQL `errors` are present (adds `errors` to context when found).
77
82
78
-
### Settings
83
+
-**Built-in pub/sub event bus**
84
+
- In-memory event manager with priorities: `subscribe(event, listener, priority)` and `publish(event, payload)`.
85
+
- Transform pipeline: `transform(event, payload)` lets you mutate `context` and `level` before logging/publishing.
86
+
- WordPress bridges: actions `wpgraphql_logging_event_{event}` and filters `wpgraphql_logging_filter_{event}` to integrate with standard hooks.
87
+
88
+
-**Monolog-powered logging pipeline**
89
+
- Default handler: stores logs in a WordPress table (`{$wpdb->prefix}wpgraphql_logging`).
90
+
- Default processors: Memory usage, memory peak, web request, process ID, and `WPGraphQLQueryProcessor` (adds `wpgraphql_query`, `wpgraphql_operation_name`, `wpgraphql_variables`).
91
+
92
+
-**Simple developer API**
93
+
-`Plugin::on()` to subscribe, `Plugin::emit()` to publish, `Plugin::transform()` to modify payloads.
94
+
95
+
-**Safe-by-default listeners/transforms**
96
+
- Exceptions in listeners/transforms are caught and logged without breaking the pipeline.
97
+
98
+
---
99
+
100
+
## Usage
101
+
102
+
WPGraphQL Logging Plugin is highly configurable and extendable and built with developers in mind to allow them to modify, change or add data, loggers etc to this plugin. Please read the docs below:
103
+
104
+
105
+
The following documentation is available in the `docs/` directory:
106
+
107
+
-[Events](docs/Events.md):
108
+
Learn about the event system, available events, and how to subscribe, transform, or listen to WPGraphQL Logging events.
109
+
110
+
-[Logging](docs/Logging.md):
111
+
Learn about the logging system, Monolog integration, handlers, processors, and how to use or extend the logger.
112
+
113
+
---
114
+
115
+
116
+
117
+
## Configuration
79
118
80
119
@TODO - When we integrate plugin configuration.
81
120
82
121
---
83
122
84
-
##Actions & Filters
123
+
### Settings
85
124
86
-
See the [Actions & Filters documentation](ACTIONS_AND_FILTERS.md) for a comprehensive list of available hooks and how to use them.
0 commit comments