Posts

Showing posts from June, 2024

Node.js certificate issues

When you encountered certificate issues when using node.js, there are some workaround that can be tried: 1) Add custom CA certs      $ export NODE_EXTRA_CA_CERTS=[your CA certificate file path] 2) Disable certificate checking      NODE_TLS_REJECT_UNAUTHORIZED

Keep current log file when using logrotate

When using logrotate in Linux, you might encounter a situation where your log file gone when the log rotated. One of the flag that you may need to notice is the  copytruncate  flag. It did not remove the current log file, instead it copy the log file and then truncate it: File name: /etc/logrotate.d/your-application  /var/log/your-application/output.log {      copytruncate     rotate 5     daily      compress     delaycompress     notifempty     missingok }