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

Please allow log file to be deleted when app is running #309

Closed
dgxhubbard opened this issue Mar 1, 2024 · 6 comments
Closed

Please allow log file to be deleted when app is running #309

dgxhubbard opened this issue Mar 1, 2024 · 6 comments

Comments

@dgxhubbard
Copy link

I was going to switch to serilog but cannot because of this issue. We delete log files while running to allow us to capture just what we need to analyze an issue instead of sifting through more information than we need.
This is an important feature.

@dgxhubbard
Copy link
Author

We do not have the log file set for shared as in this issue

                        // add a logging target for warnings and higher severity  logs
                        // structured in JSON format
                        .WriteTo.File (
                            path: loggerConfig.LogFile,
                            restrictedToMinimumLevel: logLevel,
                            outputTemplate: template,
                            formatProvider: null,
                            fileSizeLimitBytes: loggerConfig.MaxLogFileSize,
                            levelSwitch: null,
                            buffered: false,
                            shared: false,
                            flushToDiskInterval: null,
                            rollingInterval: RollingInterval.Infinite,
                            rollOnFileSizeLimit: true,
                            retainedFileCountLimit: loggerConfig.MaxArchiveFiles

                             );


@bartelink
Copy link
Member

Looks like a duplicate of #96 unless I'm mistaken? Feel free to re-open if there's a different emphasis for that versus this one

@bartelink bartelink closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2024
@dgxhubbard
Copy link
Author

It is a use case scenario of why to allow delete of log file, our settings are shared is false not true as in 96. Thus case should be reopened.

@bartelink
Copy link
Member

OK but #96 has a link to here, and the title of that issue is "Allow Log File to be Deleted at Runtime" and the title of this is "Please allow log file to be deleted when app is running".

If you feel there is context/simplifications/notes that need to be added to that issue, you could perhaps add that relevant detail there?

i.e. it seems that this issue boils down to "we have the same need to allow deletion at runtime, but we are using share: false and can't switch to true due to ).

(I personally have not thought/analyzed how the goal might be realized in any mode; I suspect a spike PR proving some viable approach without extensive changed would go a long way toward getting your need resolved)

@dgxhubbard
Copy link
Author

We have a simple use case and justification as to why to be able to delete the log file. We do it to reduce the amount of clutter in the log so we can focus on an issue and reduce time to analyze it. We cannot delete the log while running. Share true or false is not the issue. The issue is helping developers to resolve issues by reducing the amount to search through. Thus the feature request.

@bartelink
Copy link
Member

Yes, I get it. You want to be able to delete the file. So does the other person in the other case. Either way there's code to be changed, and someone needs to do it. Hopefully both can be one with a similar change. If anyone has a PR for a clean impl for either case, the chances are it will be accepted.

In the meantime, having two issues for the same need with slightly different contexts doesn't move things forward - someone ultimately needs to take time out of their jobs/lives and write code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants