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

Fallback writer in case of error #191

Open
mholt opened this issue Jul 19, 2023 · 2 comments
Open

Fallback writer in case of error #191

mholt opened this issue Jul 19, 2023 · 2 comments

Comments

@mholt
Copy link

mholt commented Jul 19, 2023

Hi Nate,

Thanks again for Lumberjack. Been using it for years now in Caddy!

We have some users (including myself, heh) who have incorrect permissions on their log folder/files. This leads to errors like write error: error getting log file info in the logs, but the actual log message is lost to oblivion. 😅

Since Lumberjack hides the underlying io.Writer, I can't figure out a way to wrap the Write() method and, if there's an error, dump the log message to stderr as a fallback.

Would this be a feature you could support?

It would be very helpful if we didn't lose log messages on an external issue like permissions.

Thanks!

@natefinch
Copy link
Owner

Hi Matt! This is a tricky one. This sounds like something that should be addressed for v3, which uses a constructor method specifically to do some sanity checks on startup.

What's your timeline for getting this done?

@mholt
Copy link
Author

mholt commented Jul 21, 2023

Sounds good to me. It's not urgent. Over the years we've had a number of questions about this, so I've learned it's not an isolated problem for sysadmins to have the wrong permissions configured. 😅

Thank you for Lumberjack

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

No branches or pull requests

2 participants