Skip to content

Commit 71196c9

Browse files
authored
fix fields issue (#3434)
1 parent 130b9c5 commit 71196c9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

app/_includes/plugins/logging/log-custom-fields-by-lua.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ The field will look like this in the log:
4242

4343
All logging plugins use the same table for logging.
4444
If you set `custom_fields_by_lua` in one plugin, all logging plugins that execute after that plugin will also use the same configuration.
45-
For example, if you configure fields via `custom_fields_by_lua` in {% unless page.name =="Syslog" %}{{page.name}}{% else %}[File Log](/plugins/file-log/){% endunless %}, those same fields will appear in [Syslog](/plugins/syslog/), since {{page.name}} executes first.
45+
For example, if you configure fields via `custom_fields_by_lua` in File log those same fields will appear in [Syslog](/plugins/syslog/), since {{page.name}} executes first.
4646

47-
If you want all logging plugins to use the same configuration, we recommend using the [Pre-function](/plugins/pre-function/) plugin to call [kong.log.set_serialize_value](/gateway/pdk/reference/kong.log/#kong-log-set-serialize-value-key-value-options) so that the function is applied predictably and is easier to manage.
47+
* If you want all logging plugins to use the same configuration, we recommend using the [Pre-function](/plugins/pre-function/) plugin to call [kong.log.set_serialize_value](/gateway/pdk/reference/kong.log/#kong-log-set-serialize-value-key-value-options) so that the function is applied predictably and is easier to manage.
4848

4949
If you **don't** want all logging plugins to use the same configuration, you need to manually disable the relevant fields in each plugin.
5050

51-
For example, if you configure a field in File Log that you don't want appearing in {{include.name}}, set that field to `return nil` in the {{include.name}} plugin:
51+
* For example, if you configure a field in File Log that you don't want appearing in Syslog, set that field to `return nil` in the File Log plugin:
5252

53-
```sh
54-
curl -i -X POST http://localhost:8001/plugins/ \
55-
...
56-
--data config.name={{include.slug}} \
57-
--data {{custom_fields_by_lua}}.my_file_log_field="return nil"
58-
```
53+
```sh
54+
curl -i -X POST http://localhost:8001/plugins/ \
55+
...
56+
--data config.name={{include.slug}} \
57+
--data {{custom_fields_by_lua}}.my_file_log_field="return nil"
58+
```
5959

6060
See the [plugin execution order reference](/gateway/entities/plugin/#plugin-contexts) for more details on plugin ordering.
6161

0 commit comments

Comments
 (0)