KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > backend > DeploymentLogger


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  * DeploymentLogger.java
26  *
27  * Created on April 25, 2002, 5:55 PM
28  *
29  * @author bnevins
30  * <BR> <I>$Source: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/deployment/backend/DeploymentLogger.java,v $
31  *
32  */

33
34 package com.sun.enterprise.deployment.backend;
35
36 import com.sun.logging.LogDomains;
37 import java.util.logging.*;
38
39 // Resource Bundle:
40
// com/sun/logging/enterprise/system/tools/deployment/backend/LogStrings.properties
41

42 public class DeploymentLogger
43 {
44     public final static Logger get()
45     {
46         // the final should cause this to be inlined...
47
return logger;
48     }
49     
50     ///////////////////////////////////////////////////////////////////////////
51

52     private DeploymentLogger()
53     {
54     }
55
56     ///////////////////////////////////////////////////////////////////////////
57

58         
59     private static Logger logger = null;
60
61     static
62     {
63         try
64         {
65             logger = LogDomains.getLogger(LogDomains.DPL_LOGGER);
66             logger.finest("Successfully created Deployment Logger");
67         }
68         catch(Throwable JavaDoc t)
69         {
70             try
71             {
72                 logger = LogDomains.getLogger(LogDomains.ROOT_LOGGER);
73                 logger.warning("Couldn't create Deployment Logger -- created a Root Logger instead");
74             }
75             catch(Throwable JavaDoc t2)
76             {
77                 // now what?
78
}
79         }
80     }
81     public static void main(String JavaDoc[] args)
82     {
83         logger.setLevel(Level.FINEST);
84         logger.info("dadads");
85         logger.log(Level.INFO, "info", new String JavaDoc[] {"Yo", "ewe" });
86         logger.log(Level.FINE, "fine", new String JavaDoc[] {"Yo", "ewe" });
87     }
88 }
89 /*
90  java.util.MissingResourceException: Can't find
91 com.sun.logging.enterprise.system.tools.deployment.backend.LogStrings bundl
92 e
93  */

94
95
Popular Tags