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

Overwriting a log file? #1912

Open
phrfpeixoto opened this issue Sep 17, 2024 · 1 comment
Open

Overwriting a log file? #1912

phrfpeixoto opened this issue Sep 17, 2024 · 1 comment
Labels
Milestone

Comments

@phrfpeixoto
Copy link
Contributor

Hello there!

I'm using monolog 2.9 and I'm looking for an easy way to overwrite a log file.
My use case is that I have processes that run in frequent intervals, and I want to be able to capture both the full log for all operations, as well as the "last log" for the latest iteration.

I fussed into the StreamHandler, and it it always fopens the file in append more.
I tried creating a custom handler, but it seems that visibility for some required methods is restricted to private.

@phrfpeixoto
Copy link
Contributor Author

I've created a quick PR #1913 to allow the user to configure this. Let me know if it helps

@Seldaek Seldaek added Feature and removed Support labels Nov 11, 2024
@Seldaek Seldaek added this to the 2.x milestone Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants