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

Append to existing log in flog instead of new file #10

Open
jan25 opened this issue Oct 22, 2018 · 2 comments
Open

Append to existing log in flog instead of new file #10

jan25 opened this issue Oct 22, 2018 · 2 comments
Assignees
Labels
kind/improve Improvement or enhancement kind/proposal Suggestion proposed

Comments

@jan25
Copy link

jan25 commented Oct 22, 2018

flog.go creates new file each time Generate is called. It'll be nice if option param can take more info about writing- to append to existing file or create new file

Thanks for great work!

@mingrammer mingrammer added kind/improve Improvement or enhancement kind/proposal Suggestion proposed labels Nov 8, 2018
@mingrammer mingrammer self-assigned this Nov 8, 2018
@mingrammer
Copy link
Owner

mingrammer commented Nov 22, 2018

"append" option is a good idea!

But I think there might be an issue for multiple log files (with split option)

apache_logs.log (500 lines)
apache_logs1.log (500 lines)
apache_logs2.log (500 lines)
apache_logs3.log (200 lines)

Then when I re-run the flog with append option, how should flog work for this case? Of course, If I re-run the flog with options which same to previous, appending is easy. It will just fill the last log file out and create new following log files will be named log4, log5 and etc.

apache_logs.log (500 lines)
apache_logs1.log (500 lines)
apache_logs2.log (500 lines)
apache_logs3.log (500 lines)
apache_logs4.log (500 lines)
apache_logs5.log (400 lines)

But, with different options, it's not easy to determine how to append the new logs to existing log files.

Do you have a good idea? :)

@brunowego
Copy link

What you think about generate a new file after X time?

apache_logs-2018-12-20-17:10.log (500 lines)
apache_logs-2018-12-20-17:20.log (500 lines)
apache_logs-2018-12-20-17:30.log (500 lines)
apache_logs-2018-12-20-17:40.log (500 lines)
apache_logs-2018-12-20-17:50.log (500 lines)
apache_logs-2018-12-20-18:00.log (400 lines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improve Improvement or enhancement kind/proposal Suggestion proposed
Projects
None yet
Development

No branches or pull requests

3 participants