mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* Allowing first-class support of structured log messages * Renaming to logWithMetadata and changing log statement structure * Fixing unit tests
19 lines
542 B
JavaScript
19 lines
542 B
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
export class AuditLogger {
|
|
constructor(server, pluginId) {
|
|
this._server = server;
|
|
this._pluginId = pluginId;
|
|
}
|
|
|
|
log(eventType, message, data = {}) {
|
|
this._server.logWithMetadata(['info', 'audit', this._pluginId, eventType], message, {
|
|
...data,
|
|
eventType,
|
|
});
|
|
}
|
|
}
|