hi,

I ma usuing svlogd to log NGINX logs loccally and usingh im_file to collect
the logs with NXLOG and send the logs to Logstash server.

<Input nginx_error>
   Module    im_file
   File      "/mnt/nginx_logs/nginx_error/current"
   exec      $tags = "write";
   exec      $type = "nginx_error";
   exec      $host = hostname();
   exec      $message = $raw_event;
   exec      to_json();
   exec      if $raw_event =~ /requester_ip/ or $raw_event =~ /inode
changed for/ { drop(); }
   exec      if $raw_event =~ /ELB-HealthChecker/ { drop(); }
</Input>

I have noticed that when svlogd rotate the current logfile NXLOG still
pointing to the old file and stop sending the logs from current to logstash
server.

run lsof -p proc returs this
nxlog   4995 root   16r   REG      202,2 99999611 7741459
/mnt/nginx_logs/nginx_fictivious/@4000000053e08c1b0d28186c.s

instead of /mnt/nginx_logs/nginx_fictivious/current

in documentaion i see that NXLOG should be aware to this to allow logrotate
externally.

1.2.14 Log rotation
Log files can be rotated by size or time without the need of external log
rotation tools. Log rotation can also be scheduled in
order to guarantee timely file rotation.
The file input reader module supports external log-rotation scripts, it can
detect when an input file was moved/renamed and will
reopen its input. Similarly, the file output writer module can also monitor
when the file being written to is rotated and will reopen
its original output. This way it is possible to keep using external log
rotation tools without the need to migrate to the built-in log
rotation.

i aprichiate any insite anyone has to fix this problem.

Thanks
Michael
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
nxlog-ce-users mailing list
nxlog-ce-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nxlog-ce-users

Reply via email to