RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → General →

Logging

Subscribe to Logging 9 posts, 6 voices

 
Dec 16, 2017 9:05pm
Avatar Dave Higton (1515) 1599 posts

SysLog is very useful, but I would like to log a fair amount of stuff on a Raspberry Pi that’s doing pretty much an embedded job – it’s headless and must be completely reliable. Since it doesn’t have a hard drive, all it has is a micro SD card. Clearly I don’t want to wear that out, so I would like to be able to log to something else.

I have a NAS with two spinning rust drives, which I try to remember to replace before they reach the end of the reliable part of their lives. So, if there were something that does a job like SysLog but to a remote medium, I’d have what I want.

Is there such a thing?

SysLog’s Help doesn’t mention remote logging, so I have to assume that it can’t do what I want.

 
Dec 16, 2017 10:27pm
Avatar Martin Avison (27) 595 posts

If you must have reliability, one question is how reliable is any link to the remote drive, and the remote drive itself? Would a local USB drive be more reliable? What about power failures?

Reporter logs to memory, but can automatically save it to a file (which could be remote) either automatically when memory is full, or from a command which could could be issued at intervals from another program. However, the remote logs would only be updated at those intervals, so log data could be lost if the Pi or its remote access failed. PM me if you want to discuss further.

Some NAS have Syslog servers (eg Synology), but whether the RISC OS version can log to them I do not know. Note that Reporter can also write to Syslog.

 
Dec 16, 2017 11:04pm
Avatar Dave Higton (1515) 1599 posts

If you must have reliability, one question is how reliable is any link to the remote drive, and the remote drive itself? Would a local USB drive be more reliable? What about power failures?

It is much more important that the logged system continue to operate, than that the logging process works.

Everything must start up correctly after a power failure. We’ve had several in the ~10 months that we’ve lived in this house, with causes shared between Electricity North West, our own breakers tripping unexpectedly, and work on the house wiring necessitating mains switch-off.

A local USB drive seems to me to cause as many problems as it solves. If it fails, the local filing system is likely to kick up an error that will stop the system. I’ve certainly had a USB flash drive fail (become read-only), and I would rather not add the cost and lifetime issue of a rotating drive – especially when I have two perfectly good ones on the LAN whose finite lifetimes are already accounted for.

 
Dec 16, 2017 11:16pm
Avatar Chris Johnson (125) 556 posts

There is a module syslogd that allows you to log to a remote machine. The help info in it says

SysLogD 0.03 (22 Jan 2003) © 1999-2003 John Tytgat / BASS

I used to use it to log stuff from other machines to an Iyonix. Not sure if it would suit you, or even if it works on ARMv7 hardware.

 
Dec 17, 2017 8:15am
Avatar Rick Murray (539) 6425 posts

It is much more important that the logged system continue to operate,

Sounds like what you need is not a better sort of media, but something that can override power disturbances entirely.

Consider something like: https://www.banggood.com/Geekworm-UPS-HAT-Board-2500mAh-Lithium-Battery-For-Raspberry-Pi-3-Model-B-Pi-2B-B-A-p-1105260.html

[this isn’t a recommendation, I don’t have this…yet.]

 
Dec 17, 2017 10:24am
Avatar Colin (478) 1664 posts

A local USB drive seems to me to cause as many problems as it solves. If it fails, the local filing system is likely to kick up an error that will stop the system.

This is the case with any filing system method isn’t it? ShareFS and LanManFS can both be prone to blocking failure modes – try opening a lanman share directory after the share has disappeared. Any logging would have to cope with the remote end disappearing and not block. The filing system can block on closing if there is unsent data in the buffers, it is waiting for a handshake and the remote end has disappeared.

One solution, if the nas has ftp, may be to ftp to the server and just implement file storing – you can append to existing files. That way with non blocking sockets you can fail in a non blocking way and build in resiliance like trying to open a connection in a non blocking way until the remote end appears again after a write has failed.

 
Dec 17, 2017 11:21am
Avatar Martin Avison (27) 595 posts

I have just tried using
*ReportSave LanMan98::DSriscos.$.Temp.Report001
which worked just fine, when that disc was mounted, giving a Reporter message of
11:02:03.04 ** Save ** LanMan98::DSriscos.$.Temp.Report001

With the disc dismounted, the Reporter message was
11:02:27.80 ** Save ** Disc not found
with no error boxes stopping processing.

Obviously there are many other scenarios which would need testing, but I did try to trap and report all save errors in the same way. Nothing is written to the local disc.

SysLogD

That module listens for incoming syslog messages and writes them to (a local) !SysLog. I think Dave would need a module that acts like !SysLog but sends syslog messages to another machine.

 
Dec 17, 2017 12:28pm
Avatar Steve Pampling (1551) 3768 posts

That module listens for incoming syslog messages and writes them to (a local) !SysLog. I think Dave would need a module that acts like !SysLog but sends syslog messages to another machine.

With a mapped drive then possibly SysLogDev
The author must be busy or I’m sure they would have chipped in.

Edit:
That said I’m inclined to check how Reporter could be used as a post boot logging tool.
Post boot since every time I’ve done a setup with it in the boot I’ve had to rebuild things, probably just a talent for breaking stuff :)

 
Dec 17, 2017 9:13pm
Avatar Dave Higton (1515) 1599 posts

Thank you for the suggestion of a UPS, but it ignores the original stated aim of preventing the SD card from wearing out. I didn’t specifically state in my original posting that settings can be changed via a web interface, which means that it must be possible to write to the SD card. These changes are much less frequent than the logging.

The context, for those who haven’t already guessed, is my new central heating control system, which is much more powerful than the previous one. I’d like to log quite a lot of information over a long period in order to get the best out of it.

My simplest option may be to put the log directory in RAM disc, and simply copy the log files over to somewhere else from time to time. It will require some splicing together of files to get a longer log, but that’s a tractable problem.

Reply

To post replies, please first log in.

Forums → General →

Search forums

Social

Follow us on and

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

Description

General discussions.

Voices

  • Dave Higton (1515)
  • Martin Avison (27)
  • Chris Johnson (125)
  • Rick Murray (539)
  • Colin (478)
  • Steve Pampling (1551)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys