Skip to content
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 post rotate callbacks #4

Merged
merged 1 commit into from
Feb 11, 2020
Merged

add post rotate callbacks #4

merged 1 commit into from
Feb 11, 2020

Conversation

tanmaykm
Copy link
Member

Added a new exported function postrotate that can be used to register a callback function to be invoked with the rotated file name just after the current log file is rotated. The file name of the rotated file is passed as an argument. The function is blocking and so any lengthy operation that needs to be done should be done asynchronously. Callbacks can be registered with both RollingFileWriter and RollingLogger instances. E.g.:

julia> postrotate(logger) do rotatedfile
           # e.g. code to upload file to permanent store
           # ...
       end

Added a new exported function `postrotate` that can be used to register a callback function to be invoked with the rotated file name just after the current log file is rotated. The file name of the rotated file is passed as an argument. The function is blocking and so any lengthy operation that needs to be done should be done asynchronously. Callbacks can be registered with both RollingFileWriter and RollingLogger instances. E.g.:

```
julia> postrotate(logger) do rotatedfile
           # e.g. code to upload file to permanent store
           # ...
       end
```
@tanmaykm tanmaykm merged commit 98926a4 into master Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant