KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > ext > logging > Logging


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24
25 package com.sun.appserv.management.ext.logging;
26
27
28 import com.sun.appserv.management.base.AMX;
29 import com.sun.appserv.management.base.XTypes;
30 import com.sun.appserv.management.base.Utility;
31 import com.sun.appserv.management.monitor.Monitoring;
32
33 /**
34     Supports accessing logging information in multiple ways. The following are supported:
35     <ul>
36     <li>Emission of pseudo real-time JMX Notifications when a
37         log record is created--see {@link LogRecordEmitter}</li>
38     <li>Access to existing log file contents--see {@link LogFileAccess}</li>
39     <li>Querying for log entries--see {@link LogQuery}</li>
40     </ul>
41     <p>
42     A Logging always has j2eeType={@link XTypes#LOGGING} and
43     the same name as the server it represents.
44     @since AS 9.0
45     @see com.sun.appserv.management.monitor.ServerRootMonitor#getLogging
46  */

47 public interface Logging
48     extends LogRecordEmitter, LogQuery, LogFileAccess, LogAnalyzer, AMX
49 {
50     public static final String JavaDoc J2EE_TYPE = XTypes.LOGGING;
51     
52    /**
53         Sets the log level of the Logger for the specified module. This operation
54         will not effect a change to the corresponding loggin configuration for that module.
55         <b>This capability is subject to removal, due to the confusion
56         caused by configuration settings not matching</b>.
57         
58         @param module a module name as specified in {@link LogModuleNames}.
59         @param level a log level
60         @see com.sun.appserv.management.config.ModuleLogLevelsConfig
61      */

62     public void setModuleLogLevel( String JavaDoc module, String JavaDoc level );
63     
64    /**
65         Gets the log level of the Logger for the specified module, which may or may not
66         be the same as that found in the configuration.
67         <b>This capability is subject to removal, due to the confusion
68         caused by configuration settings not matching</b>.
69         
70         @param moduleName a module name as specified in {@link LogModuleNames}
71         @see com.sun.appserv.management.config.ModuleLogLevelsConfig
72     */

73     public String JavaDoc getModuleLogLevel( String JavaDoc moduleName );
74     
75     /**
76         This method may be used to verify that your Logging listener is working
77         correctly.
78         @param level the log level of the log message.
79         @param message the message to be placed in Notif.getMessage()
80      */

81     public void testEmitLogMessage( final String JavaDoc level, final String JavaDoc message );
82 }
83
84
85
86
87
88
89
90
Popular Tags