OSGP / Documentation

This repository contains documentation for the Open Smart Grid Platform project. This repository is built as a GitBook, therefore all content has to be written using markdown syntax. See the latest GitBook:
https://documentation.gxf.lfenergy.org/
Apache License 2.0
24 stars 15 forks source link

Setting up GXF platform no logging after deploying applications #290

Closed MysterX83 closed 3 months ago

MysterX83 commented 4 months ago

Question: I'v setting up a VM with Postgres, ActiveMQ and Tomcat. All the directory's are set correct. I've got the issue that the applications that i am doplying into tomcat won't set any logging in "/var/log/osp/logs/". For example i am deploying 'osgp-core-5.52.0-SNAPSHOT.war', so Flyway will generate the initial tables in my postgres database.

in /opt/tomcat/logs/catalina.out i am seeing: "14-Mar-2024 09:52:02.822 INFO [http-nio-8080-exec-14] org.apache.catalina.core.StandardContext.reload Reloading Context with name [/osgp-core-5.52.0-SNAPSHOT] is completed " And no errors in this logging.

I am running tomcat under user tomcat so the dir /var/log/osp is of owner tomcat:tomcat amd also the directory /var/log/osp/logs/.

the context.xml in /opt/tomcat/conf/ is the same one as given in the project. so all the environment names are set to /etc/osp/ and i've placed there all configuration files (ive put the sample ones)

background: I am running all the platform application on one VM. This VM is a AlmaLinux release 9.3 (Shamrock Pampas Cat).

I think that i missing something but i don't know what...

smvdheijden commented 4 months ago

Which Java and Tomcat versions are you using?

MysterX83 commented 4 months ago

I am using java17 and Tomcat 19.1.19.

What i am seeing in the code is this line: @PropertySource(value = "file:${osgp/Global/config}", ignoreResourceNotFound = true)

Where 'ignoreResourceNotFound = true', this indicates that there will be no errors what so ever when configfile isn't found, i don't know if this is helpfull for finding issues.

smvdheijden commented 4 months ago

Could you give it a try using Tomcat 10? We have recently updated some libraries, after which Tomcat 10 is required.

For osgp-core the log configuration to be used is configured in the OsgpCoreInitializer class: "java:comp/env/osgp/Core/log-config". This should match with an entry in the Tomcat context.xml: <Environment name="osgp/Core/log-config" value="/etc/osp/osgp-core-logback.xml" type="java.lang.String" override="false" /> Do you have an osgp-core-logback.xml file in /etc/osp? If so, what log levels are configured?

smvdheijden commented 4 months ago

Regarding the @PropertySource annotation, the components already have a properties file included on their class path. The properties in this file could be overridden by optional properties files in /etc/osp, hence the ignoreResourceNotFound = true.

MysterX83 commented 3 months ago

I am sorry i am running Apache Tomcat Version 10.1.19

Yes i have a osgp-core-logback.xml placed in /etc/osp but it looks like this file won't load, because when i deliberately make a mistake in that config, still osgp-core component is deployed succesfull in tomcat. And no errors are logged in catalina.out

In the context.xml in /opt/tomcat/conf is the enviroment var set it look like this:

<Context useHttpOnly="true">

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->

    <!-- App config files -->
    <Environment name="osgp/Global/config" value="/etc/osp/global.properties" type="java.lang.String" override="false" />

    <Environment name="osgp/AdapterDomainAdmin/config" value="/etc/osp/osgp-adapter-domain-admin.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainAdmin/log-config" value="/etc/osp/osgp-adapter-domain-admin-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainCore/config" value="/etc/osp/osgp-adapter-domain-core.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainCore/log-config" value="/etc/osp/osgp-adapter-domain-core-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainMicrogrids/config" value="/etc/osp/osgp-adapter-domain-microgrids.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainMicrogrids/log-config" value="/etc/osp/osgp-adapter-domain-microgrids-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainDistributionAutomation/config" value="/etc/osp/osgp-adapter-domain-distributionautomation.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainDistributionAutomation/log-config" value="/etc/osp/osgp-adapter-domain-distributionautomation-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainPublicLighting/config" value="/etc/osp/osgp-adapter-domain-publiclighting.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainPublicLighting/log-config" value="/etc/osp/osgp-adapter-domain-publiclighting-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainTariffSwitching/config" value="/etc/osp/osgp-adapter-domain-tariffswitching.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainTariffSwitching/log-config" value="/etc/osp/osgp-adapter-domain-tariffswitching-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainSmartMetering/config" value="/etc/osp/osgp-adapter-domain-smartmetering.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterDomainSmartMetering/log-config" value="/etc/osp/osgp-adapter-domain-smartmetering-logback.xml" type="java.lang.String" override="false" />

    <Environment name="osgp/JasperInterface/config" value="/etc/osp/jasper-interface.properties" type="java.lang.String" override="false" />

    <Environment name="osgp/AdapterWsAdmin/config" value="/etc/osp/osgp-adapter-ws-admin.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsAdmin/log-config" value="/etc/osp/osgp-adapter-ws-admin-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsCore/config" value="/etc/osp/osgp-adapter-ws-core.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsCore/log-config" value="/etc/osp/osgp-adapter-ws-core-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsMicrogrids/config" value="/etc/osp/osgp-adapter-ws-microgrids.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsMicrogrids/log-config" value="/etc/osp/osgp-adapter-ws-microgrids-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsDistributionAutomation/config" value="/etc/osp/osgp-adapter-ws-distributionautomation.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsDistributionAutomation/log-config" value="/etc/osp/osgp-adapter-ws-distributionautomation-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsPublicLighting/config" value="/etc/osp/osgp-adapter-ws-publiclighting.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsPublicLighting/log-config" value="/etc/osp/osgp-adapter-ws-publiclighting-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsSharedDb/config" value="/etc/osp/osgp-adapter-ws-shared-db.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsSmartMetering/config" value="/etc/osp/osgp-adapter-ws-smartmetering.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsSmartMetering/log-config" value="/etc/osp/osgp-adapter-ws-smartmetering-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsTariffSwitching/config" value="/etc/osp/osgp-adapter-ws-tariffswitching.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterWsTariffSwitching/log-config" value="/etc/osp/osgp-adapter-ws-tariffswitching-logback.xml" type="java.lang.String" override="false" />`

    <Environment name="osgp/Core/config" value="/etc/osp/osgp-core.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/Core/log-config" value="/etc/osp/osgp-core-logback.xml" type="java.lang.String" override="false" />
    <Environment name="osgp/CoreDbApi/config" value="/etc/osp/osgp-core-db-api.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/CoreDbApiIec61850/config" value="/etc/osp/osgp-core-db-api-iec61850.properties" type="java.lang.String" override="false" />

    <Environment name="osgp/Logging/config" value="/etc/osp/osgp-logging.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/Logging/log-config" value="/etc/osp/osgp-logging-logback.xml" type="java.lang.String" override="false" />

    <Environment name="osgp/DomainLogging/config" value="/etc/osp/osgp-domain-logging.properties" type="java.lang.String" override="false" />

    <Environment name="osgp/SigningServer/config" value="/etc/osp/signing-server.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/SigningServer/log-config" value="/etc/osp/signing-server-logback.xml" type="java.lang.String" override="false" />

    <Environment name="osgp/AdapterProtocolDlms/config" value="/etc/osp/osgp-adapter-protocol-dlms.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterProtocolDlms/log-config" value="/etc/osp/osgp-adapter-protocol-dlms-logback.xml" type="java.lang.String" override="false" />

    <Environment name="osgp/AdapterProtocolOslp/config" value="/etc/osp/osgp-adapter-protocol-oslp.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterProtocolOslp/log-config" value="/etc/osp/osgp-adapter-protocol-oslp-logback.xml" type="java.lang.String" override="false" />

    <Environment name="osgp/AdapterProtocolOslpElster/config" value="/etc/osp/osgp-adapter-protocol-oslp-elster.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterProtocolOslpElster/log-config" value="/etc/osp/osgp-adapter-protocol-oslp-elster-logback.xml" type="java.lang.String" override="false" />

    <Environment name="osgp/AdapterProtocolIec61850/config" value="/etc/osp/osgp-adapter-protocol-iec61850.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/AdapterProtocolIec61850/log-config" value="/etc/osp/osgp-adapter-protocol-iec61850-logback.xml" type="java.lang.String" override="false" />

    <Environment name="osgp/WebDeviceSimulator/config" value="/etc/osp/web-device-simulator.properties" type="java.lang.String" override="false" />
    <Environment name="osgp/WebDeviceSimulator/log-config" value="/etc/osp/web-device-simulator-logback.xml" type="java.lang.String" override="false" />
</Context>
MysterX83 commented 3 months ago

De logging of catalina. out is:


20-Mar-2024 10:48:16.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
20-Mar-2024 10:48:16.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            5.14.0-362.18.1.el9_3.x86_64
20-Mar-2024 10:48:16.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
20-Mar-2024 10:48:16.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-17-openjdk-17.0.10.0.7-2.el9.x86_64
20-Mar-2024 10:48:16.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           17.0.10+7-LTS
20-Mar-2024 10:48:16.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Red Hat, Inc.
20-Mar-2024 10:48:16.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/tomcat
20-Mar-2024 10:48:16.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/tomcat
20-Mar-2024 10:48:16.389 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
20-Mar-2024 10:48:16.390 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
20-Mar-2024 10:48:16.390 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
20-Mar-2024 10:48:16.390 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
20-Mar-2024 10:48:16.391 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
20-Mar-2024 10:48:16.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
20-Mar-2024 10:48:16.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
20-Mar-2024 10:48:16.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
20-Mar-2024 10:48:16.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
20-Mar-2024 10:48:16.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
20-Mar-2024 10:48:16.398 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
20-Mar-2024 10:48:16.398 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
20-Mar-2024 10:48:16.398 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512M
20-Mar-2024 10:48:16.398 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1024M
20-Mar-2024 10:48:16.398 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParallelGC
20-Mar-2024 10:48:16.398 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
20-Mar-2024 10:48:16.398 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
20-Mar-2024 10:48:16.398 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
20-Mar-2024 10:48:16.409 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
20-Mar-2024 10:48:17.567 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
20-Mar-2024 10:48:17.737 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-0:0:0:0:0:0:0:1-8009"]
20-Mar-2024 10:48:17.744 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [2182] milliseconds
20-Mar-2024 10:48:17.933 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
20-Mar-2024 10:48:17.933 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.1.19]
20-Mar-2024 10:48:17.937 SEVERE [main] org.apache.catalina.startup.HostConfig.beforeStart Unable to create directory for deployment: [/opt/tomcat/conf/Catalina/localhost]
20-Mar-2024 10:48:18.049 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/osgp-secret-management-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:48:37.879 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:48:38.110 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/osgp-secret-management-5.52.0-SNAPSHOT.war] has finished in [20,061] ms
20-Mar-2024 10:48:38.134 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/web-demo-app-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:48:44.377 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:48:44.399 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/web-demo-app-5.52.0-SNAPSHOT.war] has finished in [6,264] ms
20-Mar-2024 10:48:44.457 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/osgp-adapter-ws-admin-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:48:56.825 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:48:56.837 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/osgp-adapter-ws-admin-5.52.0-SNAPSHOT.war] has finished in [12,379] ms
20-Mar-2024 10:48:56.868 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/osgp-adapter-domain-core-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:49:05.535 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:49:05.546 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/osgp-adapter-domain-core-5.52.0-SNAPSHOT.war] has finished in [8,678] ms
20-Mar-2024 10:49:05.548 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/osgp-protocol-adapter-iec61850-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:49:13.561 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:49:13.571 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/osgp-protocol-adapter-iec61850-5.52.0-SNAPSHOT.war] has finished in [8,024] ms
20-Mar-2024 10:49:13.588 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/osgp-logging-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:49:25.017 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:49:25.030 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/osgp-logging-5.52.0-SNAPSHOT.war] has finished in [11,442] ms
20-Mar-2024 10:49:25.094 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/web-device-simulator-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:49:37.490 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:49:37.526 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/web-device-simulator-5.52.0-SNAPSHOT.war] has finished in [12,432] ms
20-Mar-2024 10:49:37.575 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/osgp-adapter-ws-core-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:49:52.216 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:49:52.224 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/osgp-adapter-ws-core-5.52.0-SNAPSHOT.war] has finished in [14,648] ms
20-Mar-2024 10:49:52.262 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/osgp-adapter-domain-admin-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:50:02.827 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:50:02.838 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/osgp-adapter-domain-admin-5.52.0-SNAPSHOT.war] has finished in [10,575] ms
20-Mar-2024 10:50:02.852 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/osgp-core-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:50:11.250 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:50:11.261 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/osgp-core-5.52.0-SNAPSHOT.war] has finished in [8,409] ms
20-Mar-2024 10:50:11.273 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/osgp-protocol-simulator-iec61850-5.52.0-SNAPSHOT.war]
20-Mar-2024 10:50:12.618 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:50:12.621 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/osgp-protocol-simulator-iec61850-5.52.0-SNAPSHOT.war] has finished in [1,348] ms
20-Mar-2024 10:50:12.711 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
20-Mar-2024 10:50:13.300 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:50:13.787 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [1,077] ms
20-Mar-2024 10:50:13.787 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
20-Mar-2024 10:50:13.886 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:50:13.889 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [102] ms
20-Mar-2024 10:50:13.893 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
20-Mar-2024 10:50:13.997 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:50:14.002 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [109] ms
20-Mar-2024 10:50:14.003 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
20-Mar-2024 10:50:14.293 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:50:14.556 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [553] ms
20-Mar-2024 10:50:14.557 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
20-Mar-2024 10:50:14.676 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
20-Mar-2024 10:50:14.679 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [122] ms
20-Mar-2024 10:50:14.784 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
20-Mar-2024 10:50:14.952 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-0:0:0:0:0:0:0:1-8009"]
20-Mar-2024 10:50:15.001 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [117257] milliseconds
MysterX83 commented 3 months ago

De content of /etc/osp/osgp-core-logback.xml is:

[root@gfxtest osp]# cat  osgp-core-logback.xml
<?xml version="1.0" encoding="UTF-8"?>

<!--
SPDX-FileCopyrightText: Contributors to the GXF project

SPDX-License-Identifier: Apache-2.0
-->

<configuration debug="true">

  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [${HOSTNAME}] [%thread] %level %logger{36}@%method:%line - %msg%n</pattern>
    </encoder>
  </appender>

  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/var/log/osp/logs/osgp-core.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
      <fileNamePattern>/var/log/osp/logs/osgp-core.log.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
      <maxFileSize>100MB</maxFileSize>
      <maxHistory>10</maxHistory>
      <totalSizeCap>20GB</totalSizeCap>
    </rollingPolicy>
    <encoder>
      <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [${HOSTNAME}] [%thread] %level %logger{36}@%method:%line - %msg%n</pattern>
    </encoder>
  </appender>

  <root level="DEBUG" additivity="false">
    <appender-ref ref="CONSOLE"/>
    <appender-ref ref="FILE"/>
  </root>

</configuration>
smvdheijden commented 3 months ago

Could it be an issue with file permissions on /etc/osp and/or /var/log/osp? Or maybe SELinux is blocking access?

MysterX83 commented 3 months ago

I am running tomcat with user:group permissions tomcat:tomcat. And i start it as a service. The service file is placed in /etc/systemd/system/tomcat.service.

[Unit]
Description=Tomcat webs servlet container
After=network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment="JAVA_HOME=/usr/lib/jvm/jre"
Environment="JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"

Environment="CATALINA_BASE=/opt/tomcat"
Environment="CATALINA_HOME=/opt/tomcat"
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
Environment="CATALINA_OUT=/var/log/tomcat/catalina.out"

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
ReadWritePaths=/var/log/

[Install]
WantedBy=multi-user.target

The file permissions on /etc/osp is drwxr-xr-x. 6 tomcat tomcat 4096 Mar 20 10:47 osp The file permissions on /var/log/osp is drwxr-xr-x. 3 tomcat tomcat 4096 Mar 6 13:38 osp

i've checked SELinux by following this page: https://access.redhat.com/documentation/de-de/red_hat_enterprise_linux/8/html/using_selinux/troubleshooting-problems-related-to-selinux_using-selinux

i don't see any messages regarding writing to the log directories.

smvdheijden commented 3 months ago

I've just noticed this line in your logging: 20-Mar-2024 10:48:17.937 SEVERE [main] org.apache.catalina.startup.HostConfig.beforeStart Unable to create directory for deployment: [/opt/tomcat/conf/Catalina/localhost]. Could you try creating this folder manually (with the appropriate permissions) and see if it fixes the logging issues?

As a side note some more information regarding the logging configuration:

For the logging configuration an override/fallback mechanism is implemented in the AbstractApplicationInitializer class. The logging configuration is resolved in the following order:

If the logging is working it should be visible in the logging which configuration file is used:

The src/webapp/META-INF/ folder inside the osgp-core project also includes a context.xml which also contains the <Environment name="osgp/Core/log-config" value="/etc/osp/osgp-core-logback.xml" type="java.lang.String" override="true" /> entry.

MysterX83 commented 3 months ago

The SERVERE log is something that has to with the atrribute createDirs on the in the server.xml of tomcat. Default it is set 'true'. https://tomcat.apache.org/tomcat-10.1-doc/config/host.html

This has no negative impact on the startup of the server. When i set this attribute to false it prevent the error from logging.

Thanks for the extra information about the logging structure.

MysterX83 commented 3 months ago

Ok i have some information:

I probably didn't build the application correctly. I'm missing the webhook of the war file to actually start the application.

WEB-INF/web.xml is often used for this. However, this file does not exist in my WAR. The application is deployed but not started.

smvdheijden commented 3 months ago

web.xml should not be needed to start the application.

MysterX83 commented 3 months ago

I see, i can run osgp-core now on my windows machine with Tomcat 9.0.86. I see application logging placed in the catalina.out.
Still i have no idea why no logging appear on my linux VM. So it is something in the enviroment that's for sure.

smvdheijden commented 3 months ago

Good to read that you succeeded in running osgp-core on your windows machine.

I've been looking over the messages in this conversation in order to see if I missed something. Would it make a difference if you modify ReadWritePaths in the service file to ReadWritePaths=/var/log/osp/ (followed by systemctl daemon-reload) since the tomcat user probably does not have write access to /var/log/? Does the path /var/log/osp/logs/ already exists? If it does, is it also owned by the tomcat user?

smvdheijden commented 3 months ago

Closing the issue, as it seems to be something in the environment and not in the application.