-
Notifications
You must be signed in to change notification settings - Fork 125
Allow user to execute custom action on deprecated files (ex. move or send to different server) #106
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
Comments
It's not exactly what you describe, but FileLifecycleHooks (available in the preview version) should cover you here. It allows you to hook in before a new log file is opened, so you can do things like wrap the output stream in a compressing or encrypting stream, add a custom header etc. But at this point you could also scan the log folder for old files that you want to ship, compress, sign,encrypt, delete or whatever. You can see an example implementation at /cocowalla/serilog-sinks-file-header. |
Sounds like a great candidate for an |
@nblumhardt presumably this would only apply to Do we want the presence of an In terms of API, we could have: or maybe The idea with the latter being that the |
I put PR , It you see some improvements/issues please let me know |
Add OnFileRemoving life cycle hook #106
Just a note to say there is a new FileLifecycleHooks-based plugin available that uses this |
Can we allow different action on obsolete files ?
I think it would be beneficial in situation when old logs should be archived by moving to different folder or different server (dedicated only for logs)
/// Action that should be preformed on obsolete(old) log files
public static Action<string> OnObsoleteFile = null;
Inside remove loop:
It is more like example, not working code :)
The text was updated successfully, but these errors were encountered: