node.js - How to handle node logs file on my server? -
i new node , ubuntu , developing node application. logs being generated @ /var/log/appname/debug.log.
whenever log file becomes big, clear logs(currently in testing phase), problem whenever have restart node server start logging again in debug.log file.
can please tell me reason this(i using non root user log , clear) ?
how handle log files in production ? read cron job(logrotate) in linux, can please guide me how handle logs through cron job ?
if don't care contents of log file , wish delete without restarting server, can cat /dev/null > debug.log
. 0 contents. if care saving contents of log file, read logrotate manual typing man logrotate
command line. if want learn using cron jobs, read crontab manual typing man 5 crontab
. or can search web documentation , examples of either of tools.
Comments
Post a Comment