I am new to node and ubuntu and currently developing a node application. My logs are being generated at /var/log/appname/debug.log.
Whenever log file becomes very big, I just clear the logs(currently it is in testing phase), but the problem is whenever I do this I have to restart my node server to start logging again in my debug.log file.
Can you please tell me the reason for this(I am using non root user to log and clear) ?
How to handle log files in production ? I just read about cron job(logrotate) in linux, Can you please guide me how to handle my logs through cron job ?