users@glassfish.java.net

Re: glassfish and logging

From: <glassfish_at_javadesktop.org>
Date: Thu, 04 Sep 2008 06:49:02 PDT

Hello

Thank you for your reply.

I am not using Log4J, I allways try to stick to the java.util.logging API. Within Tomcat, I create a logging.properties file like the one I am pasting below; I place it in the root package of the web application's source code, and as far as I remember I need no extra configuration.

What I was trying to do is to figure out the concrete class that is used within Tomcat, and put it in the "Log Handler" parameter in the Glassfish admin interface ( Configurations > server-config > Logger settings > General ).

I tried with the class "java.util.logging.LogManager" and I get this error:

java.lang.IllegalAccessException: Class com.sun.enterprise.server.logging.ServerLogManager$3 can not access a member of class java.util.logging.LogManager with modifiers "protected"

I am going to try again with some other configuration, just to see if I can use a different Log Manager.

About the features that you mention on the Glassfish logging system, I'd say they are useful for a server with few users, but once I have several applications producing logs in one server I think that separating them is a must.



#
# JULI-based logging configuration
#
# see http://tomcat.apache.org/tomcat-5.5-doc/logging.html
#
handlers = 1myOrg.pack1.org.apache.juli.FileHandler, 2myOrg.pack2.org.apache.juli.FileHandler

# root handlers:
.handlers = 1myOrg.pack1.org.apache.juli.FileHandler

1myOrg.pack1.org.apache.juli.FileHandler.level = FINE
1myOrg.pack1.org.apache.juli.FileHandler.directory = /var/dev/logs/
1myOrg.pack1.org.apache.juli.FileHandler.prefix = myOrg.pack1


2myOrg.pack2.org.apache.juli.FileHandler.level = FINE
2myOrg.pack2.org.apache.juli.FileHandler.directory = /var/dev/logs/
2myOrg.pack2.org.apache.juli.FileHandler.prefix = myOrg.pack2

myOrg.package1.level = FINE
myOrg.package1.handlers = 1myOrg.pack1.org.apache.juli.FileHandler

myOrg.package1.someSubPackage.level = INFO
myOrg.package1.someSubPackage.handlers = 2myOrg.pack2.org.apache.juli.FileHandler

myOrg.package2.level = FINE
myOrg.package2.handlers = 2myOrg.pack2.org.apache.juli.FileHandler
[Message sent by forum member 'cesarico' (cesarico)]

http://forums.java.net/jive/thread.jspa?messageID=297193