Page 1 of 2

[IMPLEMENTED] MXdiags when run as server - log rotate

Posted: Mon 17 Aug 2020 4:42 pm
by HansR
If CMX is run as server continuously on e.g. Linux, the MXdiags file may become large, especially in debug mode.
Maybe it's an idea to restart the diags at rollover or some other time as that timeslot may become too crowded.
Maybe it is better to keep more diags in that case to have the startup session always available.

Re: MXdiags when run as server

Posted: Mon 17 Aug 2020 4:57 pm
by freddie
A possible solution is to have the log file name use the date that a message is logged. This has the advantage that each individual log file would be written to over a 24-hour period - thus some control over file size - and there would be an automatic rollover to a new file at midnight. You could include a parameter in the ini file (and in the admin screens) to specify the number of days of logs to keep.

Re: MXdiags when run as server

Posted: Mon 17 Aug 2020 8:12 pm
by mcrossley
I have thought about this before, let me see what I can come up with...

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 4:50 pm
by mcrossley
Is 5MB as a max log file size too small?

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 4:56 pm
by freddie
IMO yes - by an order of magnitude :D

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 5:08 pm
by rogerthn
My log file 20200817-182026.txt, with debug is now 48M ;)

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 6:22 pm
by HansR
mcrossley wrote: Thu 20 Aug 2020 4:50 pm Is 5MB as a max log file size too small?
My normal running log is less than 400K/day, but if debug is on that would be a bit larger I assume.

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 6:28 pm
by freddie
HansR wrote: Thu 20 Aug 2020 6:22 pm
mcrossley wrote: Thu 20 Aug 2020 4:50 pm Is 5MB as a max log file size too small?
My normal running log is less than 400K/day, but if debug is on that would be a bit larger I assume.
@rogerthn's reply would suggest with debug switched on you are approaching 20MB per day. I personally leave debug on all the time as you never know when a problem may occur. My latest log file covers 3 days and (almost) 3 hours - it is 115MB. Perhaps something around 50MB daily to err on the cautious side?

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 6:31 pm
by ConligWX
Yep, log rotation, sounds like a plan! :clap:
mcrossley wrote: Thu 20 Aug 2020 4:50 pm Is 5MB as a max log file size too small?
yes...smaller than my 27Gb logfile I got a few months ago yes (without debug)

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 6:46 pm
by mcrossley
The rate of growth depends on the station type to some extent, Davis with loop data every 2 seconds will grow more quickly than say a Fine Offset.

Ok, I think we are probably looking at something like 20MB as an upper limit. It's not the file size itself that is the problem, more the speed of opening it in an editor, and adding as attachments.

What is the attachment size limit on the forum?

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 6:47 pm
by HansR
freddie wrote: Thu 20 Aug 2020 6:28 pm @rogerthn's reply would suggest with debug switched on you are approaching 20MB per day. I personally leave debug on all the time as you never know when a problem may occur. My latest log file covers 3 days and (almost) 3 hours - it is 115MB. Perhaps something around 50MB daily to err on the cautious side?
Yes, but some confidence that you don't need debug on all the time is justified.
And apart from that: the debug info size is highly dependent on the station type.

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 7:06 pm
by freddie
mcrossley wrote: Thu 20 Aug 2020 6:46 pm What is the attachment size limit on the forum?
10MiB, but is configurable.

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 7:44 pm
by mcrossley
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!

Re: MXdiags when run as server

Posted: Thu 20 Aug 2020 8:52 pm
by Phil23
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.

Re: MXdiags when run as server

Posted: Fri 21 Aug 2020 6:44 am
by Phil23
Just a further question relating to running as a Service.

Would there be no issues in having a browser permanently open on the dashboard page.

If you were to do that I assume it the socket port would timeout after a period.

I assume that could be edited in the appropriate script, but the few searches I've made haven't popped up an answer as yet.

Phil.