rivantsov / vita

VITA Application Framework
MIT License
59 stars 15 forks source link

Log clean up #159

Closed jasonlaw closed 3 years ago

jasonlaw commented 3 years ago

Hi @rivantsov ,

If we have log and errorlog configured, will the log files grow forever? Will it split to new file when reaching certain size? How do we do the clean up?

Thanks in advance.

rivantsov commented 3 years ago

Logging to files is definitely not prod-level facility, it is strictly a shortcut for debugging, especially for web server apps. On a live web server, with multiple users, file logs will be a total mess, all queries mixed up. that's why there's no log file management there - I did not want to encourage this use.
Instead, use database, look at Logging module and WebTest project, it has logging to database setup. Unfortunately, there's no UI for now to look at logs, just mgmt studio. But entire log for a single client request should be in a single record in the database, this would make it a bit easier to investigate. For more advanced (and heavy load) scenarios, one should look at setting up some specialized logging services, possibly on the web or in the cloud.

jasonlaw commented 3 years ago

Thanks for the advice, clear now. :)