applicationinsights
Version:
Microsoft Application Insights module for Node.js
27 lines • 1.2 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiagnosticLogger = void 0;
const baseDiagnosticLogger_1 = require("./baseDiagnosticLogger");
class DiagnosticLogger extends baseDiagnosticLogger_1.BaseDiagnosticLogger {
constructor(instrumentationKey, agentLogger = console) {
super(instrumentationKey, agentLogger);
}
logMessage(diagnosticLog) {
this._addCommonProperties(diagnosticLog);
this._agentLogger.log(diagnosticLog);
}
_addCommonProperties(diagnosticLog) {
diagnosticLog.time = new Date().toUTCString();
diagnosticLog.extensionVersion = this._extensionVersion;
diagnosticLog.instrumentationKey = this._instrumentationKey;
diagnosticLog.language = this._language;
diagnosticLog.loggerName = this._loggerName;
diagnosticLog.siteName = this._siteName;
diagnosticLog.sdkVersion = this._sdkVersion;
diagnosticLog.subscriptionId = this._subscriptionId;
}
}
exports.DiagnosticLogger = DiagnosticLogger;
//# sourceMappingURL=diagnosticLogger.js.map
;