mirror of
https://github.com/Ellpeck/ExtremelySimpleLogger.git
synced 2024-11-22 01:53:29 +01:00
write to log files with read-write file share enabled
This commit is contained in:
parent
7838ec967e
commit
205dde65c3
2 changed files with 3 additions and 3 deletions
|
@ -114,7 +114,7 @@ namespace ExtremelySimpleLogger {
|
||||||
|
|
||||||
private StreamWriter Append() {
|
private StreamWriter Append() {
|
||||||
try {
|
try {
|
||||||
return this.file.AppendText();
|
return new StreamWriter(this.file.Open(FileMode.Append, FileAccess.Write, FileShare.ReadWrite));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new IOException($"Failed to append to directory sink file {this.file}", e);
|
throw new IOException($"Failed to append to directory sink file {this.file}", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace ExtremelySimpleLogger {
|
||||||
return this.file;
|
return this.file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private const int OneGb = 1024 * 1024 * 1024;
|
private const int OneGb = 1024 * 1024 * 1024;
|
||||||
private readonly FileInfo file;
|
private readonly FileInfo file;
|
||||||
private readonly StreamWriter writer;
|
private readonly StreamWriter writer;
|
||||||
|
@ -94,7 +94,7 @@ namespace ExtremelySimpleLogger {
|
||||||
|
|
||||||
private StreamWriter Append() {
|
private StreamWriter Append() {
|
||||||
try {
|
try {
|
||||||
return this.file.AppendText();
|
return new StreamWriter(this.file.Open(FileMode.Append, FileAccess.Write, FileShare.ReadWrite));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new IOException($"Failed to append to file sink {this.file}", e);
|
throw new IOException($"Failed to append to file sink {this.file}", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue