Spectrum Spatial (SSA/LIM)

Expand all | Collapse all

Setting Spectrum Spatial Analyst (SSA) logs to production

  • 1.  Setting Spectrum Spatial Analyst (SSA) logs to production

    Posted 05-26-2019 21:43
    Hi,

    SSA can produce a lot of log files when in production, I'm wondering how I can change the log level from INFO to WARN so that these files dont grow so quickly?

    I know this can be done in Spectrum but I don't know if there is an easy way to do this in SSA.

    ------------------------------
    Duri Bradshaw
    Spatial IT Consultant
    Insight GIS
    ------------------------------


  • 2.  RE: Setting Spectrum Spatial Analyst (SSA) logs to production

    Posted 05-27-2019 01:36
    Hi Duri,

    Interesting question! Mostly, I have configured logs mainly for Spectrum.
    I can see a section in logging.properties files under the following path:
    • \SpectrumSpatialAnalyst\Tomcat\AnalystAdmin\conf
    • \SpectrumSpatialAnalyst\Tomcat\AnalystConnect\conf
    • \SpectrumSpatialAnalyst\Tomcat\AnalystLocate\conf

    There seems to be a section where there is an option to configure the level of logs.
    Will be keen to get confirmation from SSA Engineers too.

    ------------------------------
    Ruchi Mishra
    Pitney Bowes Australia Pty Ltd
    Melbourne
    ------------------------------



  • 3.  RE: Setting Spectrum Spatial Analyst (SSA) logs to production

    Posted 01-08-2020 00:18
    Hey Duri, Did you ever get a definitive answer for this? just noticed our logs are creeping​

    ------------------------------
    Kieran McGowan
    IT/GIS Officer
    Corangamite Shire Council
    Camperdown
    ------------------------------



  • 4.  RE: Setting Spectrum Spatial Analyst (SSA) logs to production

    Posted 01-23-2020 21:12
    Edited by Duri Bradshaw 01-23-2020 21:19
    Hi Kieran,

    I have done some experimentation and I have managed to change the logging level, I'm not sure if this is the correct way to do it but its been working ok for me so far.

    The standard Tomcat Log files can be changed in <ssadir>/analyst/connect/conf/logging.properties
    I set all AsyncFileHandler.level = WARNING (not really sure what this does)
    I set all ContainerBase level = WARN
    I would also like to test the AsyncFileHandler.maxDays setting but I have not yet had a chance to do this
    ############################################################
    # Handler specific properties.
    # Describes specific configuration info for Handlers.
    ############################################################
    
    1catalina.org.apache.juli.AsyncFileHandler.level = WARNING
    1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
    1catalina.org.apache.juli.AsyncFileHandler.maxDays = 90
    
    2localhost.org.apache.juli.AsyncFileHandler.level = WARNING
    2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
    2localhost.org.apache.juli.AsyncFileHandler.maxDays = 90
    
    3manager.org.apache.juli.AsyncFileHandler.level = WARNING
    3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
    3manager.org.apache.juli.AsyncFileHandler.maxDays = 90
    
    4host-manager.org.apache.juli.AsyncFileHandler.level = WARNING
    4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
    4host-manager.org.apache.juli.AsyncFileHandler.maxDays = 90
    
    java.util.logging.ConsoleHandler.level = WARNING
    java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
    
    
    ############################################################
    # Facility specific properties.
    # Provides extra control for each logger.
    ############################################################
    
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = WARN
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.AsyncFileHandler
    
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = WARN
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.AsyncFileHandler
    
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = WARN
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.AsyncFileHandler​


    To change the logs for SSA you need to dig a bit deeper and fined <ssadir>/analyst/connect/webapps/connect/WEB-INF/classes/log4j2.xml

    In the logger section you can change the level for most of the SSA specific logs
    I changed the info to warn and left everything else as it was

        <Loggers>
            <AsyncLogger name="UsageStatisticsLogger" level="warn" additivity="false"/>
            <Logger name="MappingTransactionMonitor" level="warn" additivity="false">
                <AppenderRef ref="MappingService"/>
            </Logger>
            <Logger name="FeatureTransactionMonitor" level="off" additivity="false">
                <AppenderRef ref="FeatureService"/>
            </Logger>
            <Logger name="GeometryTransactionMonitor" level="off" additivity="false">
                <AppenderRef ref="GeometryService"/>
            </Logger>
            <Logger name="com.pb.stratus" level="warn" additivity="false">
                <AppenderRef ref="Connect"/>
            </Logger>
            <Root level="error">
                <AppenderRef ref="default"/>
            </Root>
        </Loggers>

    The last log you may not wish to disable is the local_access_log, this can be disabled here <ssadir>/analyst/connect/conf/server.xml
    I simply commented out the <Valve> section under the localhost <Host> section
          <Host name="localhost"  appBase="webapps"
                unpackWARs="true" autoDeploy="true">
    
            <!-- SingleSignOn valve, share authentication between web applications
                 Documentation at: /docs/config/valve.html -->
            <!--
            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
            -->
    
            <!-- Access log processes all example.
                 Documentation at: /docs/config/valve.html
                 Note: The pattern used is equivalent to using pattern="common" -->
            <!-- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
                   prefix="localhost_access_log" suffix=".txt"
                   pattern="%h %l %u %t &quot;%r&quot; %s %b" /> -->
    
          </Host>

    Please note
    I have not toughly tested these changes so if you decide to make any of these changes you do so at your own risk. Always make sure you have a backup of any configuration file before editing.

    ------------------------------
    Duri Bradshaw
    Spatial IT Consultant
    Insight GIS
    ------------------------------