Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

[IMPLEMENTED] MXdiags when run as server - log rotate

A Forum to archive Cumulus MX development suggestions that have been rejected or solved by other means.
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: MXdiags when run as server

Post by mcrossley »

The connection is not timed out. It will run as long as the network is up, or your browser window doesn't "sleep"
User avatar
rogerthn
Posts: 547
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: MXdiags when run as server

Post by rogerthn »

mcrossley wrote: Thu 20 Aug 2020 7:44 pm OK, I think a 20MB log should zip down to around 1MB if my calcs are correct.

I'll start with 20MB and see how that goes!
Successful log rotate :D

Code: Select all

2020-08-25 18:40:00.443 Rotating log file, new log file will be: 20200825-184000.txt
Size 20972354 bytes.
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: MXdiags when run as server

Post by mcrossley »

:thumbsup:
User avatar
HansR
Posts: 6926
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: MXdiags when run as server

Post by HansR »

Works fine. One additional remark: maybe its useful to append to the existing log file at the start of CMX i.s.o. creating a new one? (in case of backup, testing or whatever would restart CMX more often than expected)
Hans

https://meteo-wagenborgen.nl
CMX build 4070+ ● RPi 4B ● Linux 6.6.62+rpt-rpi-v8 aarch64 (bookworm) ● dotnet 8.0.1
BlueSky: https://bsky.app/profile/wagenborgenwx.bsky.social
User avatar
radilly
Posts: 123
Joined: Fri 17 Jul 2015 11:01 am
Weather Station: Ambient WS-2080
Operating System: Raspberry Pi 3, OS Buster Lite
Location: McMurray, PA, US
Contact:

Re: MXdiags when run as server

Post by radilly »

Phil23 wrote: Thu 20 Aug 2020 8:52 pm Random thought I had a few days back about the service was outputting data to a telnet port.

Don't know the implications; it just came to mind while opening a terminal connection to another device.

Phil.
FYI - Syslog is a fairly standard way to externalize logging. I tinkered with it for my gateway-router, but decided there wasn't much benefit for my usage.
https://en.wikipedia.org/wiki/Syslog
Cheers,
Bob
User avatar
radilly
Posts: 123
Joined: Fri 17 Jul 2015 11:01 am
Weather Station: Ambient WS-2080
Operating System: Raspberry Pi 3, OS Buster Lite
Location: McMurray, PA, US
Contact:

Re: MXdiags when run as server

Post by radilly »

FYI - I've been tinkering with logrotate on a Pi for some services I've written. It's a pretty widely used facility in Linux administration. I looked quickly but didn't spot a Windows port that was being actively maintained.

My logs, and I think the typical logrotate model are logs that get appended to across restarts. The rotating is independent of the service starts and stops.

Reference: https://linux.die.net/man/8/logrotate

I will say that when I wrote my own rotate function I would
  • rename the log
  • tail the renamed file to start the (new) log, like 100 lines
That creates some overlap that has been useful when the event would otherwise span 2 logs.


I couldn't spot how to enable this feature. Is it always on? Looks like my log runs roughly 100 KB / day when there are no issues, and I seem to be restarting often enough not to hit the limit.

Bob
Cheers,
Bob
User avatar
radilly
Posts: 123
Joined: Fri 17 Jul 2015 11:01 am
Weather Station: Ambient WS-2080
Operating System: Raspberry Pi 3, OS Buster Lite
Location: McMurray, PA, US
Contact:

Re: MXdiags when run as server

Post by radilly »

Oh, another Unixy model familiar to systemd users is journalctl. My services leverage the journal for error conditions, and keep their own detailed logs for info and debug messages as well. I use journalctl first, and dig into the full log if I want more context.

Ref: https://manpages.debian.org/stretch/sys ... .1.en.html
Cheers,
Bob
Locked