1<!-- Log.md - Removable HEADER Start --> 2 3Last edited: May 14, 2018 4 5<!-- Removable HEADER End --> 6 7## <a name="log_top"></a> Log Files 8 9> [Table of Contents](#doc_top) 10 11> [Requirement](#log_req) 12 13> [Description](#log_des) 14 15> [Yearly Logs](#log_year) 16 17### <a name="log_req"></a> Requirement 18 19> - **logrotate** 20 21> NCID uses **logrotate** to prune its log files each month. When it prunes the 22 log, it saves a backup. Up to five backups are saved. 23 24> Another system log rotation program can be used but it must be configured 25 to zero (empty) the log each month in order to use the **ncid-yearlog** 26 program. 27 28 29### <a name="log_des"></a> Description 30 31> Here is an alphabetical list of NCID log files stored in /var/log: 32 33>> 34Log file name |Log type|Description 35--------------|--------|:---------- 36cidcall.log | server |Calls and messages 37ciddata.log | server |Raw data received by ncidd server as captured from modems and gateways* 38lcdncid.log | client |LCDproc client activity 39ncid2ncid.log | gateway|NCID-to-NCID gateway activity 40ncidd.log | server |Server activity 41obi2ncid.log | gateway|OBihai gateway activity 42rn2ncid.log | gateway|Remote Notifier gateway activity 43sip2ncid.log | gateway|SIP gateway activity 44wc2ncid.log | gateway|Whozz Calling gateway activity 45xdmf2ncid.log | gateway|XDMF gateway activity 46yac2ncid.log | gateway|YAC gateway activity 47 48 49> *Note: If /var/log/ciddata.log exists, ncidd will write to it. It must be manually created prior to launching ncidd: 50 51> sudo touch /var/log/ciddata.log 52 53> Each month **logrotate** uses /etc/logrotate.d/ncid to prune files as required in 54 /usr/local/etc/ncid/ncidrotate.conf. Only two variables are expected to change: *RotateOff* and *Lines2keep*. 55 56> If the user does not want a log rotated, set *RotateOff=1*. This will let the log keep growing until the operating system decides it is too large. 57 58> The default for *Lines2keep* is 0. Some users like to keep some lines in the log when 59 it is pruned. If you would like to keep the last 10 lines at the start of the month, set 60 *Lines2keep=10* 61 62> If you turned rotation off or do not prune a log to zero each month, you should backup 63 the log to someplace that is not /var. 64 65### <a name="log_year"></a> Yearly Logs 66 67> NCID can keep yearly logs automatically in $HOME/ncid/log/ by running 68 /usr/share/ncid/sys/ncid-yearlog on the first of every month from the user's crontab. 69 70> If **ncidrotate.conf** has *Lines2keep=0* and **rotatebysize.conf** has *minsize 1*, 71 you can enable **ncid-yearlog** by creating or editing a crontab and adding this line 72 (NOTE: /usr/share can be /usr/local/share on some operating systems): 73 74> 11 5 1 * * /usr/share/ncid/sys/ncid-yearlog 75