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.
Related
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.
In JBoss AS in domain mode how can I manage server resources programmatically, that is by my own client app?
That is - to create/remove start/stop servers, server groups, deploy/undeploy applications etc.
I read that this can be achieved by using JMX MBeans. However when running in standalone mode i could list all jboss MBeans, but in domain mode can see only ModuleLoader MBean. Anyway, i found by using JMX MBeans that have to write very long code. So here are the questions:
1) is there a client library for JBoss server resource management for Java?
2) if there is only by JMX to manage resources, then how can i list all MBeans of the server in domain mode? i put <remoting-connector/> in domain.xml but should i have to specify anything anywhere else?
The tools i am using are: JBoss Wildfly 8.1, IntelliJ IDEA 13.1, Java 8, Windows 8.1/Debian 7.
Thanks in advance.
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.
We have ported an EJB application from BEA Weblogic 8.1 to Glassfish 2.1.
The client is accessing the server through RMI, no web client.
In Weblogic exceptions were logged automatically to server.log, even when they are catched and rethrown to the client.
In Glassfish with default configuration we can't see them in server.log.
How can I get the same behavior as with Weblogic?
Glassfish 2.1 logs via java.util.logging. Logging content, by default, is collected in
[Glassfish root]/domains/[domain name]/logs/server.log
For configuring j.u.l, find the logging.properties file in the JRE that is used to run Glassfish (in the lib directory), set your topics' (loggers') levels to desired granularity.
Note: that worked for me for an application using Apache Commons Logging, running on Glassfish.
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.