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

Unable to delete the log file used by zap. #1469

Open
charankamarapu opened this issue Nov 15, 2024 · 0 comments
Open

Unable to delete the log file used by zap. #1469

charankamarapu opened this issue Nov 15, 2024 · 0 comments

Comments

@charankamarapu
Copy link

Describe the bug
I have add a file to the development config like this -

LogCfg.OutputPaths = []string{
		"stdout",
		"./logs.txt",
}

and then created a logger with logCfg.build() and later while exiting my application I wanted to delete that file but it throws an error saying file is being used by another process(windows) most probably it is being used by the logger. I was creating the file to upload the logs to somewhere and once app is about to exit I want to delete it. How can I do it? I even tried assigning nil to logger before deleting the file.

To Reproduce
You can just create a simple logger and try to delete the log file.

Expected behavior
File should get deleted.

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

No branches or pull requests

1 participant