Skip to content

Commit 200957b

Browse files
authored
Add plugin API for customizing the logging configuration (#68704)
1 parent 71d54c8 commit 200957b

File tree

149 files changed

+1963
-692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1963
-692
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AppenderConfigType](./kibana-plugin-core-server.appenderconfigtype.md)
4+
5+
## AppenderConfigType type
6+
7+
8+
<b>Signature:</b>
9+
10+
```typescript
11+
export declare type AppenderConfigType = TypeOf<typeof appendersSchema>;
12+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CoreSetup](./kibana-plugin-core-server.coresetup.md) &gt; [logging](./kibana-plugin-core-server.coresetup.logging.md)
4+
5+
## CoreSetup.logging property
6+
7+
[LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md)
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
logging: LoggingServiceSetup;
13+
```

docs/development/core/server/kibana-plugin-core-server.coresetup.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface CoreSetup<TPluginsStart extends object = object, TStart = unkno
2121
| [elasticsearch](./kibana-plugin-core-server.coresetup.elasticsearch.md) | <code>ElasticsearchServiceSetup</code> | [ElasticsearchServiceSetup](./kibana-plugin-core-server.elasticsearchservicesetup.md) |
2222
| [getStartServices](./kibana-plugin-core-server.coresetup.getstartservices.md) | <code>StartServicesAccessor&lt;TPluginsStart, TStart&gt;</code> | [StartServicesAccessor](./kibana-plugin-core-server.startservicesaccessor.md) |
2323
| [http](./kibana-plugin-core-server.coresetup.http.md) | <code>HttpServiceSetup &amp; {</code><br/><code> resources: HttpResources;</code><br/><code> }</code> | [HttpServiceSetup](./kibana-plugin-core-server.httpservicesetup.md) |
24+
| [logging](./kibana-plugin-core-server.coresetup.logging.md) | <code>LoggingServiceSetup</code> | [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) |
2425
| [metrics](./kibana-plugin-core-server.coresetup.metrics.md) | <code>MetricsServiceSetup</code> | [MetricsServiceSetup](./kibana-plugin-core-server.metricsservicesetup.md) |
2526
| [savedObjects](./kibana-plugin-core-server.coresetup.savedobjects.md) | <code>SavedObjectsServiceSetup</code> | [SavedObjectsServiceSetup](./kibana-plugin-core-server.savedobjectsservicesetup.md) |
2627
| [status](./kibana-plugin-core-server.coresetup.status.md) | <code>StatusServiceSetup</code> | [StatusServiceSetup](./kibana-plugin-core-server.statusservicesetup.md) |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggerConfigType](./kibana-plugin-core-server.loggerconfigtype.md)
4+
5+
## LoggerConfigType type
6+
7+
8+
<b>Signature:</b>
9+
10+
```typescript
11+
export declare type LoggerConfigType = TypeOf<typeof loggerSchema>;
12+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) &gt; [appenders](./kibana-plugin-core-server.loggercontextconfiginput.appenders.md)
4+
5+
## LoggerContextConfigInput.appenders property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
appenders?: Record<string, AppenderConfigType> | Map<string, AppenderConfigType>;
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) &gt; [loggers](./kibana-plugin-core-server.loggercontextconfiginput.loggers.md)
4+
5+
## LoggerContextConfigInput.loggers property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
loggers?: LoggerConfigType[];
11+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md)
4+
5+
## LoggerContextConfigInput interface
6+
7+
8+
<b>Signature:</b>
9+
10+
```typescript
11+
export interface LoggerContextConfigInput
12+
```
13+
14+
## Properties
15+
16+
| Property | Type | Description |
17+
| --- | --- | --- |
18+
| [appenders](./kibana-plugin-core-server.loggercontextconfiginput.appenders.md) | <code>Record&lt;string, AppenderConfigType&gt; &#124; Map&lt;string, AppenderConfigType&gt;</code> | |
19+
| [loggers](./kibana-plugin-core-server.loggercontextconfiginput.loggers.md) | <code>LoggerConfigType[]</code> | |
20+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) &gt; [configure](./kibana-plugin-core-server.loggingservicesetup.configure.md)
4+
5+
## LoggingServiceSetup.configure() method
6+
7+
Customizes the logging config for the plugin's context.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
configure(config$: Observable<LoggerContextConfigInput>): void;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| config$ | <code>Observable&lt;LoggerContextConfigInput&gt;</code> | |
20+
21+
<b>Returns:</b>
22+
23+
`void`
24+
25+
## Remarks
26+
27+
Assumes that that the `context` property of the individual `logger` items emitted by `config$` are relative to the plugin's logging context (defaults to `plugins.<plugin_id>`<!-- -->).
28+
29+
## Example
30+
31+
Customize the configuration for the plugins.data.search context.
32+
33+
```ts
34+
core.logging.configure(
35+
of({
36+
appenders: new Map(),
37+
loggers: [{ context: 'search', appenders: ['default'] }]
38+
})
39+
)
40+
41+
```
42+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md)
4+
5+
## LoggingServiceSetup interface
6+
7+
Provides APIs to plugins for customizing the plugin's logger.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export interface LoggingServiceSetup
13+
```
14+
15+
## Methods
16+
17+
| Method | Description |
18+
| --- | --- |
19+
| [configure(config$)](./kibana-plugin-core-server.loggingservicesetup.configure.md) | Customizes the logging config for the plugin's context. |
20+

docs/development/core/server/kibana-plugin-core-server.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
108108
| [LegacyServiceSetupDeps](./kibana-plugin-core-server.legacyservicesetupdeps.md) | |
109109
| [LegacyServiceStartDeps](./kibana-plugin-core-server.legacyservicestartdeps.md) | |
110110
| [Logger](./kibana-plugin-core-server.logger.md) | Logger exposes all the necessary methods to log any type of information and this is the interface used by the logging consumers including plugins. |
111+
| [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) | |
111112
| [LoggerFactory](./kibana-plugin-core-server.loggerfactory.md) | The single purpose of <code>LoggerFactory</code> interface is to define a way to retrieve a context-based logger instance. |
113+
| [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) | Provides APIs to plugins for customizing the plugin's logger. |
112114
| [LogMeta](./kibana-plugin-core-server.logmeta.md) | Contextual metadata |
113115
| [MetricsServiceSetup](./kibana-plugin-core-server.metricsservicesetup.md) | APIs to retrieves metrics gathered and exposed by the core platform. |
114116
| [NodesVersionCompatibility](./kibana-plugin-core-server.nodesversioncompatibility.md) | |
@@ -209,6 +211,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
209211

210212
| Type Alias | Description |
211213
| --- | --- |
214+
| [AppenderConfigType](./kibana-plugin-core-server.appenderconfigtype.md) | |
212215
| [AuthenticationHandler](./kibana-plugin-core-server.authenticationhandler.md) | See [AuthToolkit](./kibana-plugin-core-server.authtoolkit.md)<!-- -->. |
213216
| [AuthHeaders](./kibana-plugin-core-server.authheaders.md) | Auth Headers map |
214217
| [AuthResult](./kibana-plugin-core-server.authresult.md) | |
@@ -242,6 +245,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
242245
| [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) | Creates an object containing request response payload, HTTP headers, error details, and other data transmitted to the client. |
243246
| [KnownHeaders](./kibana-plugin-core-server.knownheaders.md) | Set of well-known HTTP headers. |
244247
| [LifecycleResponseFactory](./kibana-plugin-core-server.lifecycleresponsefactory.md) | Creates an object containing redirection or error response with error details, HTTP headers, and other data transmitted to the client. |
248+
| [LoggerConfigType](./kibana-plugin-core-server.loggerconfigtype.md) | |
245249
| [MIGRATION\_ASSISTANCE\_INDEX\_ACTION](./kibana-plugin-core-server.migration_assistance_index_action.md) | |
246250
| [MIGRATION\_DEPRECATION\_LEVEL](./kibana-plugin-core-server.migration_deprecation_level.md) | |
247251
| [MutatingOperationRefreshSetting](./kibana-plugin-core-server.mutatingoperationrefreshsetting.md) | Elasticsearch Refresh setting for mutating operation |

0 commit comments

Comments
 (0)