-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Storage Configuration #392
Comments
The current fikle which is there as symlink is not sufficient? |
我们的监听日志文件是用java写的,可能没有配置symlink的支持,我也fork了项目,添加了 export default class FileStreamRotator extends EventEmitter {
rotate(force: boolean = false) {
let oldFile = this.currentFile;
this.rotator.rotate(force);
this.currentFile = this.rotator.getNewFilename();
let _filename = this.currentFile;
if (this.config.options?.fixed_name) {
let logPath = path.dirname(this.currentFile);
_filename = logPath + path.sep + this.config.options?.fixed_name;
}
// oldfile same as new file. do nothing
if (this.currentFile == oldFile) {
return;
}
// close old file and watcher if exists.
if (this.fs) {
// if (this.logWatcher) {
// this.logWatcher.close()
// }
if (this.config.options?.end_stream === true) {
this.fs.end();
} else {
this.fs.destroy();
}
if (oldFile && this.config.options?.fixed_name) {
this.saveOldLog(oldFile, _filename);
}
}
// add old file to audit
if (oldFile) {
this.auditManager.addLog(oldFile);
}
this.createNewLog(_filename);
this.emit('new', _filename);
this.emit('rotate', oldFile, _filename, force);
}
private saveOldLog(saveFilename: string, filename: string) {
makeDirectory(saveFilename);
fs.copyFileSync(filename, saveFilename);
}
} |
@chenyulun Can you please write in english? |
Our listening log file is written in java, may not have configured symlink support, I also forked the project, added fixed_name, in the creation of the file and the backup date to do the differences |
Can you realize that the current log is written to a file without a date, and the next day the file is dumped to a file with a date for backup, which is not the same as creating createSymlink?
Because our file-listening service (the log-collecting service) doesn't support createSymlink and can only listen to a single file
The text was updated successfully, but these errors were encountered: