File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes logging in SUN AS and JSR047 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "logging in SUN AS and JSR047" Watch "logging in SUN AS and JSR047" New topic

logging in SUN AS and JSR047

Maris Orbidans
Ranch Hand

Joined: Mar 08, 2004
Posts: 149

I am using SUN AS 8.1 PE and JDK 1.4 logging.

How can I set logging level for all package ?

I want log messages with FINE level to be written in server.log.

If I add property lv.mypackage with value FINEST in Module Log Level page in SUN AS console then it desn't work. It still writes messages only with INFO level or above in server.log. I have noticed that I need to specify exact class name in the configuration, but I don't want to list all my classes in SUN AS console!

Furthermore it seems that it should work, according to this specification:

Loggers are normally named entities, using dot separated names such as �java.awt�. The
namespace is hierarchical and is managed by the LogManager. The namespace should typically
be aligned with the Java packaging namespace, but is not required to follow it slavishly. For
example, a Logger called �java.awt� might handle logging requests for classes in the java.awt
package, but it might also handle logging for classes in sun.awt that support the client-visible
abstractions defined in the java.awt package.
In addition to named Loggers, it is also possible to create anonymous Loggers that don�t appear
in the shared namespace. See Section 2.14.
By default, loggers send their output to a set of global Handlers managed by the LogManager
infrastructure class (see 2.7 below).
The LogManager class allows log levels to be updated for named loggers. Setting a level for a
given named Logger will also affect all its children. So setting a log level for �javax.swing�
will also affect javax.swing.text� and �javax.swing.table� and �javax.swing.table.header�. The
LogManager keeps track of level settings and when a new named Logger is created it is assigned
the appropriate Level for its point in the naming hierarchy.
I agree. Here's the link:
subject: logging in SUN AS and JSR047
It's not a secret anymore!