Debug log, never stops !

A place to report bugs and discuss testing
Post Reply
Message
Author
dj-eon
Posts: 89
Joined: Wed Jul 13, 2011 4:03 am
Location: UK

Debug log, never stops !

#1 Post by dj-eon » Fri Jun 27, 2014 6:59 am

Hi there.
Can someone help?
I'm trying to switch off the debug log as its continually writing to the hard drive. Is it possible to stop this altogether?

I've set these option:
object types > system > debug default > FALSE
Configuration > debug mode > FALSE

But when I look at the debug log, its still adding these every few seconds:

Starting to run osae_sp_run_scheduled_methods
Minute timer

Its continually writing to the hard drive which I think will severely impact its life over a few years.

Is there any way to stop this?
Thanks,
Eon.

Automate
Posts: 1691
Joined: Sat Dec 11, 2010 1:44 pm
Location: US

Re: Debug log, never stops !

#2 Post by Automate » Fri Jun 27, 2014 7:10 am

See this.
https://github.com/opensourceautomation ... issues/112

A fix for the 0.4.3 problem was found but 0.4.4 completely changes all the logging.
In 0.4.4 everything gets logged to the SQL database instead of text files.

I can probably post a fixed 0.4.3 OSAE.API.dll that allows you to turn off the debug logging.

dj-eon
Posts: 89
Joined: Wed Jul 13, 2011 4:03 am
Location: UK

Re: Debug log, never stops !

#3 Post by dj-eon » Fri Jun 27, 2014 7:29 am

Hi Automate.
It seems a bit overkill to be logging that information every second or two ?

Will there be no correct way to stop that in 0.4.4 either (I'm guessing you may not have an answer to that one) ?

I am tempted to patch it, but I'm guessing the problem will come back in the next release if its logging it.

Thanks,
Ian.

Vaughn
Site Admin
Posts: 1432
Joined: Thu May 13, 2010 2:17 pm

Re: Debug log, never stops !

#4 Post by Vaughn » Fri Jun 27, 2014 7:44 am

I am not sure how it works and was wondering myself. When logging, there is specific "debug" entries, and you can use that to filter out looking at them, but I am not sure if the logger is looking at the System.Debug property. If debug is off, those lines should not be written at all. I will test it on my source when I get home tonight.

Even if the Log4W does not support it, we can add a few lines in the API call to make sure they do not get written.

This will be done before the 044 release...


Vaughn

Automate
Posts: 1691
Joined: Sat Dec 11, 2010 1:44 pm
Location: US

Re: Debug log, never stops !

#5 Post by Automate » Fri Jun 27, 2014 8:38 am

There was a discussion about this a while back. http://www.opensourceautomation.com/php ... 8012#p8012

I tend to agree with dj-eon that to save the disk drive I don't wan't everything logged.

But now I'm thinking we should have a DEBUG property per plugin rather than a global one that turns on all debug logging for all plugins

You may be having intermittent problems with one plugin. So you want to get detailed logging for that plugin and let it run for a week or so but you don't want to turn on debug logging for everything.

dj-eon
Posts: 89
Joined: Wed Jul 13, 2011 4:03 am
Location: UK

Re: Debug log, never stops !

#6 Post by dj-eon » Sat Jun 28, 2014 5:51 am

Sorry guys, I've made a mistake here.

These entries in the debug log:
Starting to run osae_sp_run_scheduled_methods
Minute timer

These are only writing to the drive every minute. I'm fine with that.
I am seeing my drive light flash 2 or 3 times a second.
Its turned out to be MySQL that's bashing my hard drive. Even with OSA shut down it still happens. Only when I close MySQL it stops.

If I solve this, I'll let you know. (I think its the event scheduler.)

Thanks,
Eon.

Automate
Posts: 1691
Joined: Sat Dec 11, 2010 1:44 pm
Location: US

Re: Debug log, never stops !

#7 Post by Automate » Sat Jun 28, 2014 7:56 am

Eon,

Most likely it is still OSA that is causing the MySQL activity.

OSA creates MySQL Events that continue to run even after the OSA service is stopped.

One of these Events called "osae_ev_off_timer" runs every second. This Event does three things
  • Updates OSA System Time
    Updates total occupancy count
    Updates all the off delay object timers
I'm currently not using occupancy count and any off delays so I have commented out that code. But even with this disabled, the system still writes the time properties to the DB every second. I've thought it might be good for OSA to support some "memory" tags that are not written to the DB every time they change. In this way the system would not need to constantly write to the disk.

Vaughn
Site Admin
Posts: 1432
Joined: Thu May 13, 2010 2:17 pm

Re: Debug log, never stops !

#8 Post by Vaughn » Mon Jun 30, 2014 10:03 pm

OK, there are 2 Debug options, one in SYSTEM, and the other in the plugins. If you set SYSTEM.Debug = False, there is no Debug log entries written, regarless. If SYSTEM.Debug=True, then it is up to the plugin to implement it own Debug property and decide when to write.

I have implemented the first option tonight. I will put the second option in the Screens application tomorrow. I will get to my plugins later.

Vaughn

Post Reply