Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Starting liferay with elastic's apm outputs errors
Hello,
I've tried to start the liferay application together with the Elastic's APM agent.The application is starting eventually(it takes a bit longer) , however, it outputs some errors in the catalina.out.
This is my setenv.sh file
Logs without the agent started
Logs with the agent started
After the app is started, even the GET/POST requests are visible in Kibana->APM, however, I would very much like to solve the errors.Can you help me guys?Many thanks,
Catalin
I've tried to start the liferay application together with the Elastic's APM agent.The application is starting eventually(it takes a bit longer) , however, it outputs some errors in the catalina.out.
This is my setenv.sh file
Logs without the agent started
Logs with the agent started
After the app is started, even the GET/POST requests are visible in Kibana->APM, however, I would very much like to solve the errors.Can you help me guys?Many thanks,
Catalin
Why don't you start Elasticsearch in an extra process, completely unrelated from Liferay and configure the remote ES service then in Liferay?
It is the recommended way and you shouldn't face these issues in that setup.
https://help.liferay.com/hc/en-us/articles/360018175651-Configuring-Elasticsearch
It is the recommended way and you shouldn't face these issues in that setup.
https://help.liferay.com/hc/en-us/articles/360018175651-Configuring-Elasticsearch
Hi Christoph,First of all, thanks for replying to my thread.
The article mentioned earlier reffers to the elasticsearch componenet, however I am looking to use APM agent component.
So basically, once I start the liferay app, there's an extra JAR file started, the APM agent.
This is being done by modifying the tomcat's setEnv.sh file, adding -javaagent:elastic-apm-agent-1.18.0.RC1.jar to the CATALINA_OPTS variable.Many thanks,
Catalin
The article mentioned earlier reffers to the elasticsearch componenet, however I am looking to use APM agent component.
So basically, once I start the liferay app, there's an extra JAR file started, the APM agent.
This is being done by modifying the tomcat's setEnv.sh file, adding -javaagent:elastic-apm-agent-1.18.0.RC1.jar to the CATALINA_OPTS variable.Many thanks,
Catalin
I see.
Maybe you have to ask this in an Elasticsearch forum since the error is APM related. And since it is that early, it might not be even Liferay related. What happens when you attach the agent to a normal tomcat, without Liferay on the same server? Should be easy to test.
If it works, I would try to compare the conf/ folders, especially logging.properties since the error seems to be somehow related to logging.
Maybe you have to ask this in an Elasticsearch forum since the error is APM related. And since it is that early, it might not be even Liferay related. What happens when you attach the agent to a normal tomcat, without Liferay on the same server? Should be easy to test.
If it works, I would try to compare the conf/ folders, especially logging.properties since the error seems to be somehow related to logging.
Hi Catalin,
OSGI environment can cause some problems to the APM applications because it hides the global java packages from its internal classloaders.
To avoid this issues, you have also to configure Elastic APM packages (co.elastic.apm.agent.*) in the OSGI bootdelegation properties module.framework.properties.org.osgi.framework.bootdelegation in the portal-ext.properties file
That will allow Elastic APM to be accessed from all OSGI classloaders:
OSGI environment can cause some problems to the APM applications because it hides the global java packages from its internal classloaders.
To avoid this issues, you have also to configure Elastic APM packages (co.elastic.apm.agent.*) in the OSGI bootdelegation properties module.framework.properties.org.osgi.framework.bootdelegation in the portal-ext.properties file
That will allow Elastic APM to be accessed from all OSGI classloaders:
- Copy default value of module.framework.properties.org.osgi.framework.bootdelegation property from portal.properties file to portal-ext.properties
- Add co.elastic.apm.agent.* at the end of it.
Hi Jorge,I have added the co.elastic.apm.agent.* at the end of the portal-ext.properties file.
No more errors so far, except the following:
"2020-08-13 07:18:09,793 main ERROR No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2"
But, most probably this can be changed in tomcat's config.
Thank you very much for your help!
I really appreciate it.
Regards,
Catalin
No more errors so far, except the following:
"2020-08-13 07:18:09,793 main ERROR No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2"
But, most probably this can be changed in tomcat's config.
Thank you very much for your help!
I really appreciate it.
Regards,
Catalin
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™