pandora-component-file-logger-service
Advanced tools
Comparing version 2.0.0-zbeta.5 to 2.0.0-zbeta.7
@@ -11,2 +11,3 @@ import { FileLoggerRotator } from './FileLoggerRotator'; | ||
startAtAllProcesses(): Promise<void>; | ||
startRecordingCoreLogger(): void; | ||
} | ||
@@ -13,0 +14,0 @@ export * from './FileLoggerManager'; |
@@ -15,2 +15,4 @@ "use strict"; | ||
const FileLoggerManager_1 = require("./FileLoggerManager"); | ||
const os_1 = require("os"); | ||
const path_1 = require("path"); | ||
let ComponentFileLoggerService = class ComponentFileLoggerService { | ||
@@ -39,3 +41,13 @@ constructor(ctx) { | ||
await this.fileLoggerManager.start(); | ||
this.startRecordingCoreLogger(); | ||
} | ||
startRecordingCoreLogger() { | ||
const coreLogger = this.ctx.logger; | ||
const config = this.ctx.config.coreLogger; | ||
if (!config.enable) { | ||
return; | ||
} | ||
const ownLogger = this.fileLoggerManager.createLogger('core', Object.assign({}, config)); | ||
coreLogger.set('file', ownLogger.get('file')); | ||
} | ||
}; | ||
@@ -48,2 +60,10 @@ ComponentFileLoggerService = __decorate([ | ||
stopWriteWhenNoSupervisor: true, | ||
}, | ||
coreLogger: { | ||
enable: false, | ||
dir: path_1.join(os_1.homedir(), 'logs', 'pandorajs'), | ||
type: 'size', | ||
maxFileSize: 100 * 1024 * 1024, | ||
stdoutLevel: 'NONE', | ||
level: 'WARN' | ||
} | ||
@@ -50,0 +70,0 @@ }) |
{ | ||
"name": "pandora-component-file-logger-service", | ||
"version": "2.0.0-zbeta.5", | ||
"version": "2.0.0-zbeta.7", | ||
"description": "Pandora 2 Component File Logger Service", | ||
@@ -29,3 +29,3 @@ "main": "dist/ComponentFileLoggerService", | ||
"nyc": "^13.1.0", | ||
"pandora-component-ipc-hub": "^2.0.0-zbeta.5" | ||
"pandora-component-ipc-hub": "^2.0.0-zbeta.7" | ||
}, | ||
@@ -64,7 +64,7 @@ "nyc": { | ||
"mz": "^2.6.0", | ||
"pandora-component-decorator": "^2.0.0-zbeta.5", | ||
"pandora-component-reporter-manager": "^2.0.0-zbeta.5", | ||
"pandora-dollar": "^2.0.0-zbeta.5", | ||
"pandora-messenger": "^2.0.0-zbeta.5" | ||
"pandora-component-decorator": "^2.0.0-zbeta.7", | ||
"pandora-component-reporter-manager": "^2.0.0-zbeta.7", | ||
"pandora-dollar": "^2.0.0-zbeta.7", | ||
"pandora-messenger": "^2.0.0-zbeta.7" | ||
} | ||
} |
@@ -5,2 +5,4 @@ import {MessengerServer, MessengerClient} from 'pandora-messenger'; | ||
import {FileLoggerManager} from './FileLoggerManager'; | ||
import {homedir} from 'os'; | ||
import {join} from 'path'; | ||
@@ -12,2 +14,10 @@ @componentName('fileLoggerService') | ||
stopWriteWhenNoSupervisor: true, | ||
}, | ||
coreLogger: { | ||
enable: false, | ||
dir: join(homedir(), 'logs', 'pandorajs'), | ||
type: 'size', | ||
maxFileSize: 100 * 1024 * 1024, | ||
stdoutLevel: 'NONE', | ||
level: 'WARN' | ||
} | ||
@@ -45,4 +55,17 @@ }) | ||
await this.fileLoggerManager.start(); | ||
this.startRecordingCoreLogger(); | ||
} | ||
startRecordingCoreLogger() { | ||
const coreLogger = this.ctx.logger; | ||
const config = this.ctx.config.coreLogger; | ||
if(!config.enable) { | ||
return; | ||
} | ||
const ownLogger: Map<string, any> = <any> this.fileLoggerManager.createLogger('core', { | ||
...config | ||
}); | ||
coreLogger.set('file', ownLogger.get('file')); | ||
} | ||
} | ||
@@ -49,0 +72,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65545
1410