mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Ingest] Use Kibana logger for proper server-side logging (#66017)
* Add logger to app context.
This commit is contained in:
parent
49226ddc1f
commit
a1a157dc87
2 changed files with 12 additions and 1 deletions
|
@ -8,6 +8,7 @@ import { first } from 'rxjs/operators';
|
|||
import {
|
||||
CoreSetup,
|
||||
CoreStart,
|
||||
Logger,
|
||||
Plugin,
|
||||
PluginInitializerContext,
|
||||
SavedObjectsServiceStart,
|
||||
|
@ -73,6 +74,7 @@ export interface IngestManagerAppContext {
|
|||
isProductionMode: boolean;
|
||||
kibanaVersion: string;
|
||||
cloud?: CloudSetup;
|
||||
logger?: Logger;
|
||||
httpSetup?: HttpServiceSetup;
|
||||
}
|
||||
|
||||
|
@ -108,6 +110,7 @@ export class IngestManagerPlugin
|
|||
private config$: Observable<IngestManagerConfigType>;
|
||||
private security: SecurityPluginSetup | undefined;
|
||||
private cloud: CloudSetup | undefined;
|
||||
private logger: Logger | undefined;
|
||||
|
||||
private isProductionMode: boolean;
|
||||
private kibanaVersion: string;
|
||||
|
@ -117,6 +120,7 @@ export class IngestManagerPlugin
|
|||
this.config$ = this.initializerContext.config.create<IngestManagerConfigType>();
|
||||
this.isProductionMode = this.initializerContext.env.mode.prod;
|
||||
this.kibanaVersion = this.initializerContext.env.packageInfo.version;
|
||||
this.logger = this.initializerContext.logger.get();
|
||||
}
|
||||
|
||||
public async setup(core: CoreSetup, deps: IngestManagerSetupDeps) {
|
||||
|
@ -208,6 +212,7 @@ export class IngestManagerPlugin
|
|||
kibanaVersion: this.kibanaVersion,
|
||||
httpSetup: this.httpSetup,
|
||||
cloud: this.cloud,
|
||||
logger: this.logger,
|
||||
});
|
||||
licenseService.start(this.licensing$);
|
||||
return {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { first } from 'rxjs/operators';
|
||||
import { SavedObjectsServiceStart, HttpServiceSetup } from 'src/core/server';
|
||||
import { SavedObjectsServiceStart, HttpServiceSetup, Logger } from 'src/core/server';
|
||||
import { EncryptedSavedObjectsPluginStart } from '../../../encrypted_saved_objects/server';
|
||||
import { SecurityPluginSetup } from '../../../security/server';
|
||||
import { IngestManagerConfigType } from '../../common';
|
||||
|
@ -21,6 +21,7 @@ class AppContextService {
|
|||
private isProductionMode: boolean = false;
|
||||
private kibanaVersion: string | undefined;
|
||||
private cloud?: CloudSetup;
|
||||
private logger?: Logger;
|
||||
private httpSetup?: HttpServiceSetup;
|
||||
|
||||
public async start(appContext: IngestManagerAppContext) {
|
||||
|
@ -29,6 +30,7 @@ class AppContextService {
|
|||
this.savedObjects = appContext.savedObjects;
|
||||
this.isProductionMode = appContext.isProductionMode;
|
||||
this.cloud = appContext.cloud;
|
||||
this.logger = appContext.logger;
|
||||
this.kibanaVersion = appContext.kibanaVersion;
|
||||
this.httpSetup = appContext.httpSetup;
|
||||
|
||||
|
@ -60,6 +62,10 @@ class AppContextService {
|
|||
return this.cloud;
|
||||
}
|
||||
|
||||
public getLogger() {
|
||||
return this.logger;
|
||||
}
|
||||
|
||||
public getConfig() {
|
||||
return this.configSubject$?.value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue