This page last changed on Nov 28, 2012 by mbarne36.

Hi all

My Raspberry Pi just fell over quite dramatically, and so I got under the hood and tried to figure out why.

Basically, the rootfs was full - I mean 7.8GB Full. SO I ran some diagnostics to find out who the culprit(s) were.

It turns out that Catalina.out in Openremote controller was over 5.8GB. Ouch.

It seemed to be full of stdout messages containing lots of information (some useful, and some not-so). I have a Panel running which communicates with a Python Script on the Pi, and the Python Script was not running. So when it is not running, my TCP/IP polling from the OpenRemote Controller creates an error which creates debug output into Catalina.out, which over a few hours fills up the rootfs.

(here's a sample of the error messages).
ERROR Polling Sensor Thread ID = 868, Name ='Number3Sensor': Socket event could not execute
java.net.ConnectException: Connection refused

Can the debug messages be turned off? Or can we cap the size of Catalina.out?

thanks in advance.

You can replace the OpenRemote-Controller/conf/logging.properties with this to limit the logs to 10MB size:

handlers = 1runtime.java.util.logging.FileHandler, 2localhost.java.util.logging.FileHandler, java.util.logging.ConsoleHandler

.handlers = 1runtime.java.util.logging.FileHandler, java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

1runtime.java.util.logging.FileHandler.level = FINE
1runtime.java.util.logging.FileHandler.pattern = ${catalina.base}/logs/runtime.log.%g
1runtime.java.util.logging.FileHandler.limit = 10000000
1runtime.java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

2localhost.java.util.logging.FileHandler.level = FINE
2localhost.java.util.logging.FileHandler.pattern = ${catalina.base}/logs/localhost.log.%g
2localhost.java.util.logging.FileHandler.limit = 10000000
2localhost.java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.java.util.logging.FileHandler

#org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
#org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 5host-manager.org.apache.juli.FileHandler

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = FINE
#org.apache.catalina.startup.HostConfig.level = FINE
#org.apache.catalina.session.ManagerBase.level = FINE
#org.apache.catalina.core.AprLifecycleListener.level=FINE

You can set the logging levels to higher thresholds with values 'INFO', 'WARNING' or 'SEVERE'.

Posted by juha at Nov 28, 2012 13:42

I'll give it a go... thanks Juha

Posted by mbarne36 at Nov 28, 2012 13:49

Thank you for the config file, Juha!

May I request that this be rolled into OpenRemote as default? I've also come across a 60GB catalina.out on a desktop installation, and one crashed Raspberry Pi due to the same issue of a catalina.out at 12GB.

It just seems hazardous for the default config to be as it is.

Posted by frand at Dec 10, 2012 17:16

This was included in the 2.0.1 update as well as part of 2.1 release branch, see OpenRemote Controller 2.0.1 Released for more details.

Posted by admin at Dec 10, 2012 18:12

So it is, thank you! Despite frequenting the forums, I managed to miss the release announcement

Posted by frand at Dec 10, 2012 20:58

A freshly downloaded and cleanly installed 2.0.1 has now been running for one evening, and catalina.out has already grown to ~26MB in size. Could it be that this conf does not properly limit its file-size?

Posted by frand at Dec 10, 2012 23:52

There seems to be a discrepancy between using 'openremote run' and 'openremote start' to start the controller – the latter is still creating catalina.out – need to investigate why.

Posted by juha at Dec 11, 2012 05:28

This looks to be from a standard OS (bash) level redirect of standard out and error streams to a file :

>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &

It's therefore not going through the logging.properties configuration and not limited. You can for the time being remove this line from openremote.sh file – you can look at the code branch for 'run' for example (it does not redirect standard streams, as it prints them on the console).

Not sure yet which way to resolve this – the standard out and error streams are being used by the console logging that is configured in logging.properties and it makes sense when 'run' is used so disabling them completely doesn't seem good either – and adding two separate log properties for both 'run' and 'start' is annoyingly redundant.

Posted by juha at Dec 11, 2012 05:42

Thanks for reporting this btw.

Posted by juha at Dec 11, 2012 05:42

My pleasure! Although I can't say I understand the difference or benefit of having two different commands to launch the process

Posted by frand at Dec 11, 2012 22:06

Jani

My understanding is that 'run' is blocking, and 'start' is not.

Posted by mbarne36 at Dec 12, 2012 10:25

is there already a fix for this? im using OpenRemote-Controller-2.2.0_TTS-Email-Serial.zip and my catalina.out is 1,5GB already

Posted by robnas at Dec 24, 2014 14:56
Document generated by Confluence on Jun 05, 2016 09:31