ActiveMQ generates tons of logs on Tomcat - java

I have web application with ActiveMQ and deploy it to tomcat. The problem is that activemq generates so much debug logs that physical memory on my server clogs quickly. ActiveMQ puts tons of trash to my catalina.out and it seems like debug logging, so i posted some example here.
I use ActiveMQ 5.8.0, and slf4j/log4j for logging.
The question is: how to configure tomcat/log4j/my webapp to remove those useless ActiveMQ logs?
I tried this link, but it doesnt help.

Related

Rest API logging in websphere clustured environment

I have few rest services bundled to an ear and deployed to Websphere application server in PROD clustered environment(16 Websphere app server instances). IHS webserver instances are serving the incoming requests to above app servers.
I need to capture request/response details and few logs during processing of the request. In PROD the debug log is by default disabled, I need a way to enable debug logs in all app servers without any deployments.
Please suggest.
Maybe NCSA logging is what you are looking for
https://www.ibm.com/docs/en/was-nd/9.0.5?topic=application-enabling-access-logging

How to check logs for running container on Heroku?

I deployed a sample Java app like container on Heroku. I made heroku container:push <name> and heroku container:release <name> afterwards. Commands worked but I don't understand if the app itself is running since it should fire few times per day.
I tried to see general logs, got nothing. Where can I find container-related logs in Heroku?
UPDATE:
My logs are the following:
2019-12-18T21:21:20.002711+00:00 app[api]: Release v4 created by user
2019-12-18T21:21:20.002711+00:00 app[api]: Deployed worker
(c77c435c1355) by user
After this, no logs appeared.
If you use a logging framework (log4j, java Logging) you still need to initialise it to log to the stdout (Console), you should then be able to see your logs in the Heroku "View Logs" (or indeed with CLI heroku logs).
Are you using log4j? Add log4j.properties in the classpath of your apps.
You can also try the System.out.println to log into the stdout.
Hope it helps.
Beppe
As #Beppe C's answer mentions, I can use log4j or similar logging solutions.
There are a couple of possibilities for logging.
Use plugins in Heroku such as Papertrail that will scrape logs from Docker and post them into themselves. You can see, filter, search, and archive logs there.
Use external systems such as Sentry, AWS Cloudwatch, you name it. You will need to set up appenders and config to where to send logs. They will be sent from application. You will see only application-specific logs, not Heroku specific as in the 1st solution.
You have two main options, and sometimes it's just a good idea to use them both.

Logging framewok for Websphere Application Server 7

I have tried several logging frameworks (log4j / slf4j with logback/ commons-logging) on websphere to redirect each application log on a separate file, without any sucess.
If i have two applications deployed on same JVM: I am not able to know related errors of each application: All non catched exceptions gets redirected to SystemOut.log file, instead of getting redirected to the appropriate application log file.
Is there any way to achieve that on websphere ?
It would be useful if you post the configuration files you've tried for each logging framework, and provide more details of each scenario. I have used log4j and logback with WebSphere and never ran into problems like yours.

How to log to syslog from clustered Java application server

My Java EE application, which currently runs on Glassfish 3, is currently using java.util.logging to send logmessages. This is intercepted by Glassfish and written to files.
I'd like to switch to a centralised logging solution, since the application is going to be distributed in a cluster.
I have an existing syslog infrastructure. Do you have any suggestion, how to get the application to log to syslog? Glassfish's log-to-syslog feature has no documentation and no configuration, so I haven't considered it much.
What about migrating to SLF4J and using the SLF4J syslog appender?
Please have a look a look at Glassfish to Syslog which shows how to let GlassFish 3 log to system log/syslog via UDP 514 on localhost.

What is a good way to handle slf4j logging in a web app deployed in Glassfish 3.0.1?

I have a quite ordinary web application which logs with slf4j, which is fine, and I have used several slf4j backends without any problems.
Under Tomcat I just told logback to point at a location in the filesystem and log there, but now I want to deploy several independent instances of this application each in its own domain in a single Glassfish 3.0.1 instance, and I have now found that I would like my slf4j logging to work well with Glassfish.
What would be a good way (dare I say "best") to have my logging taken care of by Glassfish. Should I just flatten my logs to System.out with logback and let Glassfish handle the console output, or is there a better, standard way to reach the loggers inside Glassfish?
EDIT: Investigation has shown that GlassFish 3.0.1 does not provide neither the SLF4J API or a binding in the classes visible to a JSP-page with default configuration.
By providing slf4j-api-X.jar and slf4j-jdk14-X.jar the slf4j-logging events are forwarded to java.util.logging which is captured properly by Glassfish (see http://docs.sun.com/app/docs/doc/820-7692/abluj?l=en&a=view for details).
Investigation has shown that GlassFish 3.0.1 does not provide neither the SLF4J API or a binding in the classes visible to a JSP-page with default configuration.
By providing slf4j-api-X.jar and slf4j-jdk14-X.jar the slf4j-logging events are forwarded to java.util.logging which is captured properly by Glassfish (see http://docs.sun.com/app/docs/doc/820-7692/abluj?l=en&a=view for details).
Note: Glassfish logging does not capture stack traces.

Categories