PFC200 logging to SD

Hi!

Do anyone have experience on using SD for storage for system logs?

I’ve got the following instructions:

Do the following:
/etc/init.d/syslog-ng

edit the line

export LOGPATH=“/var/log/”

export WAGOLOGPATH_RAM=“/var/log/wago”

as follows:

export LOGPATH=“/media/sd/var/log/”

export WAGOLOGPATH_RAM=“/media/sd/var/log/wago/”

After that, the controller would have to be restarted.

Alternatively, the syslog daemon can simply be restarted with the following command:

./etc/init.d/syslog-ng restart

What should be taken into the consideration?

I know, corruption of SD card is possible. What happens for the PLC if the logging is set to SD and the SD is not available anymore? Is it possible to set primary and fail over location for logs? To primarily log to SD but change location to RAM if it is not available.

Logging to SD is needed to debug issue that reboots the controller after long period of running.

Thanks!

-Lauri

Hi,

I would suggest to use logrotate for such kind of need.
You may keep writing logs to internal memory of PLC, but move the archives to SD card with postrotate function of logrotate.
This will definitely extend the lifetime of SD card, i.e. no line by line writing, but as whole file.

2 Likes