Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

  • I have a Mango installation that is not creating logfiles.

    On a particular date, the database apparently became corrupted, according to ma.log, and logging ceased some time thereafter. Upon deleting the database and restoring from an earlier backup as per this thread, logging has not resumed, although everything else seems okay.

    Does anyone have any suggestions for things I could check that could interfere with logging, or any information I could provide that might point to a possible cause?

    The Mango version is v3.4.5 on a Raspberry Pi 3 running Raspbian 9.


  • Assuming you didn't modify your startup scripts your logging configuration will be defined in this file:

    <ma-home>/classes/log4j2.xml
    

    This file defines where the logs are written to, perhaps this file is corrupt/missing or has been modified to write the logs into a folder that Mango does not have permission to write to.

    You should be able to startup mango and see the output on the console, I'm pretty sure in 3.4 if you do this:

    sudo su <mango-user>
    cd <ma-home>
    ./bin/ma.sh start
    

    you will see the output in the console and potentially see error messages about the logging system.


  • Thank you for your quick reply. The there were several instances of the word "log" in the console output, but none that seemed to indicate an error.

    The full output is at:
    https://pastebin.com/8H2wYpie


  • Furthermore, the log4j2.xml file appears to be in good order, and the permissions for the log directory are such that the root user may read and write. Mango is set up to run as a service as per the instructions, which I believe results in it running as root.


  • Hi Matthew,

    While I've never seen it there on a PI, you could check to see if there's a Mango/bin/logs/ directory containing the log file.

    Your boot output appears to be a regular boot. Other things that could be affecting what's happening:

    1. You have a Mango/overrides/classes/log4j2.xml file
    2. You have moved the debug-logging script from Mango/bin/ext-available to ext-enabled.

    I find it strange that your log output has,

    Oct 24, 2018 8:24:45 PM com.serotonin.m2m2.db.H2Proxy initializeImpl
    INFO: Initializing H2 connection manager
    Oct 24, 2018 8:24:49 PM com.serotonin.m2m2.db.upgrade.DBUpgrade checkUpgrade
    INFO: Starting instance with core version 3.4.5, db 25
    Oct 24, 2018 8:24:49 PM com.serotonin.m2m2.rt.DataSourceGroupInitializer initialize
    INFO: Initializing 5 NORMAL priority data sources in 8 threads.
    Oct 24, 2018 8:24:56 PM com.serotonin.m2m2.rt.RuntimeManagerImpl initializeDataSourceStartup
    Oct 24, 2018 8:25:01 PM com.serotonin.m2m2.rt.DataSourceGroupInitializer initialize
    INFO: Initialization of 5 NORMAL priority data sources took 11839ms
    

    Which is anomalous in having a different format than the default, and not logging all the statements that are logged in the default. So, you must have modified your logging configuration. I'd say go back to using the default log4j2.xml file.


  • I just thought of another possibility. Mango 3.x uses Log4J2 where previous versions of Mango used Log4j. If you have a log4j jar that is getting loaded it won't pickup the log42.xml configuration and would probably use some default of only printing to stdout.

    I would check your <ma-home>/lib folder and see if there are log4j and log4j2 jars.

    ls <ma-home>/lib/*log4j*
    

    This should list only these jars:

    lib/log4j-api-2.10.0.jar	lib/log4j-jcl-2.10.0.jar
    lib/log4j-core-2.10.0.jar	lib/log4j-slf4j-impl-2.10.0.jar